]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lib: fix memory leak
authorWataru Ashihara <wsh@iij.ad.jp>
Wed, 4 Sep 2019 02:59:03 +0000 (11:59 +0900)
committerVincent Bernat <vincent@bernat.ch>
Wed, 4 Sep 2019 08:32:59 +0000 (10:32 +0200)
src/lib/connection.c

index 88bbc99906505f8aabb49e5406451a9ea8b2b86c..aa88dadf2a6edaa80ae596456c5d5da2e627f2f7 100644 (file)
@@ -114,6 +114,7 @@ lldpctl_new_name(const char *ctlname, lldpctl_send_callback send, lldpctl_recv_c
        }
        if (!send && !recv) {
                if ((data = malloc(sizeof(struct lldpctl_conn_sync_t))) == NULL) {
+                       free(conn->ctlname);
                        free(conn);
                        return NULL;
                }