[ovs-dev] [coverity 09/14] socket-util: Free strings in make_sockaddr_un() error handling.

Justin Pettit jpettit at nicira.com
Tue Feb 22 01:44:52 UTC 2011


Coverity #10721,10720
---
 lib/socket-util.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/socket-util.c b/lib/socket-util.c
index 469131d..275bf30 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -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;
             }
 
-- 
1.7.1





More information about the dev mailing list