[PATCH 09/13] idiag: fix memory leak in idiagnl_msg_set_cong()

Thomas Haller thaller at redhat.com
Mon Nov 24 08:14:53 PST 2014


Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 lib/idiag/idiag_msg_obj.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/idiag/idiag_msg_obj.c b/lib/idiag/idiag_msg_obj.c
index 00c0562..1d9fde8 100644
--- a/lib/idiag/idiag_msg_obj.c
+++ b/lib/idiag/idiag_msg_obj.c
@@ -324,6 +324,7 @@ char *idiagnl_msg_get_cong(const struct idiagnl_msg *msg)
 
 void idiagnl_msg_set_cong(struct idiagnl_msg *msg, char *cong)
 {
+	free (msg->idiag_cong);
 	msg->idiag_cong = strdup(cong);
 }
 
-- 
1.9.3




More information about the libnl mailing list