]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crush/builder.c: fix realloc handling 83/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 28 Feb 2013 17:07:28 +0000 (18:07 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 28 Feb 2013 17:07:28 +0000 (18:07 +0100)
commit2f66b493b2a49b7800009076d309438440923253
treee3d50625edb62b9b533ea205426e0221cb70e0d7
parent9b87690ffd3fb4e36a61d3866b623ffef7a83e3d
crush/builder.c: fix realloc handling

Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.

Use a temporary pointer to hold the result of realloc(). In error case
return -ENOMEM, otherwise assign it to the pointer we want to realloc.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/crush/builder.c