Fix: Memory leak on error paths of relay_add_stream
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 28 Feb 2013 20:48:24 +0000 (15:48 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 21 Mar 2013 17:14:28 +0000 (13:14 -0400)
commit5af40280abf6f969256e044e106f524a2a0df16d
tree3ce75cff019f4948f39ee6b6b358b2857842020b
parent534b3ed8dd2a11b8fc7228cfe053ffdaad6e18fb
Fix: Memory leak on error paths of relay_add_stream

On error paths the memory allocated for stream is never freed.

Also, fix undefined behavior on asprintf alloc failure. According to
asprintf(3), the content of the pointer passed to it is undefined if an
alloc failure occurs, so we could end up freeing a pointer in an
undefined state. Force its value to NULL.

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c
This page took 0.025098 seconds and 4 git commands to generate.