commit | 2eae3a0497f01960dd7f4ffc638f11fc36aa5991 | [log] [tgz] |
---|---|---|
author | Hubert Verstraete <hubs@users.sourceforge.net> | Tue Jun 28 22:41:00 2016 +0200 |
committer | Willy Tarreau <w@1wt.eu> | Wed Jun 29 10:45:15 2016 +0200 |
tree | 6f4e9a7c4ea39e3ea4e1bc65bf72c85ca1389b41 | |
parent | a9300a3d5a068c6e6c0a95f2a2640df557aa0a4c [diff] |
MINOR: new function my_realloc2 = realloc + free upon failure When realloc fails to allocate memory, the original pointer is not freed. Sometime people override the original pointer with the pointer returned by realloc which is NULL in case of failure. This results in a memory leak because the memory pointed by the original pointer cannot be freed.