This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 05/17] Regex: Avoid memory leaks.


On 12/08/2017 01:16 AM, Arnold Robbins wrote:
+                 if (new_array_start != NULL)
+                     re_free(new_array_start);

For this rarely-used code, it's better to omit the first line and simply call re_free unconditionally, as this is simpler and likely will make for fewer instructions in the executable. re_free will do the right thing if new_array_start is NULL.

Aside from that, this patch is essentially the same as:

https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=9e849a708308b73064cd965de022d357e3abda80

which is already installed in Gnulib.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]