socket-util: Free strings in make_sockaddr_un() error handling.
authorJustin Pettit <jpettit@nicira.com>
Tue, 22 Feb 2011 00:38:39 +0000 (16:38 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 22 Feb 2011 17:40:01 +0000 (09:40 -0800)
Coverity #10721,10720

lib/socket-util.c

index 469131d..275bf30 100644 (file)
@@ -270,6 +270,8 @@ make_sockaddr_un(const char *name, struct sockaddr_un *un, socklen_t *un_len,
 
             dirfd = open(dir, O_DIRECTORY | O_RDONLY);
             if (dirfd < 0) {
+                free(base);
+                free(dir);
                 return errno;
             }