]> granicus.if.org Git - libnl/commitdiff
idiag: fix memory leak in idiagnl_msg_set_cong()
authorThomas Haller <thaller@redhat.com>
Mon, 24 Nov 2014 16:14:53 +0000 (17:14 +0100)
committerThomas Haller <thaller@redhat.com>
Mon, 24 Nov 2014 17:30:21 +0000 (18:30 +0100)
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
lib/idiag/idiag_msg_obj.c

index 00c0562b933727f1638d02d53f7e829ab0a6484d..1d9fde8a769a52fbd3ed1639b469879d75ced52b 100644 (file)
@@ -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);
 }