Re: [PATCH 1/2] sha1_file: replace PATH_MAX buffer wirh strbuf in prepare_packed_git_one()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 28, 2014 at 9:47 PM, René Scharfe <l.s.r@xxxxxx> wrote:
> -       sprintf(path, "%s/pack", objdir);
> -       len = strlen(path);
> -       dir = opendir(path);
> +       strbuf_addstr(&path, objdir);
> +       strbuf_addstr(&path, "/pack");
> +       dir = opendir(path.buf);
>         if (!dir) {
>                 if (errno != ENOENT)
>                         error("unable to open object pack directory: %s: %s",
> -                             path, strerror(errno));
> +                             path.buf, strerror(errno));
>                 return;

Memory leak. The rest looks good.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]