git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: Junio C Hamano <junkio@cox.net>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] path-list.c: always free strdup'ed paths
Date: Sat, 7 Jul 2007 20:39:10 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707072036530.4093@racer.site> (raw)
In-Reply-To: <468FEC54.307@lsrfire.ath.cx>

Hi,

On Sat, 7 Jul 2007, Ren? Scharfe wrote:

> Always free .paths if .strdup_paths is set, no matter if the
> parameter free_items is set or not, plugging a minor memory leak.
> And to clarify the meaning of the flag, rename it to free_util,
> since it now only affects the freeing of the .util field.

The rational was that it might very well be possible that the pointers you 
hand to the path_list are already strdup()ed. So you do not set 
strdup_paths, but you want them free()d.

The .util field is in many cases something that is not trivially free()d, 
but has to call a type-specific function, such as path_list_clear() 
itself.

So I'm mildly negative about your patch.

Ciao,
Dscho

  reply	other threads:[~2007-07-07 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-07 19:41 [PATCH] path-list.c: always free strdup'ed paths René Scharfe
2007-07-07 19:39 ` Johannes Schindelin [this message]
2007-07-07 20:03   ` René Scharfe
2007-07-07 20:27     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0707072036530.4093@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).