lkml.org 
[lkml]   [2020]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] perf tools: Improve exception handling in two functions of perf events parser
From
Date
> Fix potential memory leak. Function new_term may return error, so
> it is need to free memory when the return value is negative.

How do you think about a wording variant like the following?

Add jump targets so that a configuration object and a duplicated string
are released after a call of the function “strdup” or “new_term” failed.

Regards,
Markus

\
 
 \ /
  Last update: 2020-06-11 21:10    [W:0.075 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site