Re: [PATCH] mailmap: fix check for freeing memory
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Aug 20, 2013, 13:40 UTC
- Message-ID
- <878uzw7a6l.fsf@linux-k42r.v.cablecom.net>
- In-Reply-To
- <1377004958-14489-1-git-send-email-stefanbeller@googlemail.com>
Stefan Beller <stefanbeller@googlemail.com> writes:
> The condition as it is written in that line was most likely intended to > check for the pointer passed to free(), rather than checking for the > 'repo_abbrev', which is already checked against being non null at the > beginning of the function.
[...]
> - if (repo_abbrev) > + if (*repo_abbrev) > free(*repo_abbrev);
But now the test is useless, because free(NULL) is defined to be a no-op.
--
Thomas Rast
trast@{inf,student}.ethz.ch