Fix libxenstore memory leak when USE_PTHREAD is not defined
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Mon, 17 Sep 2012 10:17:03 +0000 (11:17 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Mon, 17 Sep 2012 10:17:03 +0000 (11:17 +0100)
commit201d1fba8cabe8fdee746822fd81d060f7f25f2e
tree2ebe8e8ed52697cc22eeb4e631384f0f9760fc69
parenta73a7a0c647a9a5e30d8bc473c0a1e8648817183
Fix libxenstore memory leak when USE_PTHREAD is not defined

Redefine usage of pthread_cleanup_push and _pop, to explicitly call free for
heap objects in error paths.

By the way, set a suitable errno value for an error path that had none.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenstore/xs.c