On Monday 28 of May 2012 13:41:22 Jiri Moskovcak wrote:
On 04/13/2012 06:10 PM, Jakub Filak wrote:
> ---
>
> src/plugins/rhbz.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
> index 2e7d62c..b5f73b0 100644
> --- a/src/plugins/rhbz.c
> +++ b/src/plugins/rhbz.c
> @@ -131,6 +131,11 @@ static unsigned find_best_bt_rating_in_comments(GList
> *comments)>
> errno = 0;
> char *e;
> long rating = strtoul(rating_srt,&e, 10);
>
> +
> + /* rating_str can be safely freed here because the following code
> + * works only with memory address and not with the memory itself
> */ + free(rating_srt);
> +
>
> if (errno || rating_srt == e || *e != '\0' || rating>
UINT_MAX)
------------- I'm not sure if this ^^^^^^^^^ is safe after
free(rating_str)
You are right. It isn't safe. My bad (I tried to add only an one extra line to
sort out this leak). I sent a new patch a few minutes ago.
> {
>
> /* error / no digits / illegal trailing chars */