Fix two memory leaks.
authoryinpeijun <yinpeijun@huawei.com>
Mon, 28 Jul 2014 07:21:17 +0000 (15:21 +0800)
committerBen Pfaff <blp@nicira.com>
Mon, 28 Jul 2014 16:20:24 +0000 (09:20 -0700)
Found by coverity.

Signed-off-by: yinpeijun <yinpeijun@huawei.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
lib/stream-ssl.c
ovsdb/ovsdb-server.c

diff --git a/AUTHORS b/AUTHORS
index 3e97bbe..6c5fea0 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -136,6 +136,7 @@ Wei Yongjun             yjwei@cn.fujitsu.com
 William Fulton
 YAMAMOTO Takashi        yamamoto@valinux.co.jp
 Yasuhito Takamiya       yasuhito@gmail.com
+yinpeijun               yinpeijun@huawei.com
 Yu Zhiguo               yuzg@cn.fujitsu.com
 ZhengLingyun            konghuarukhr@163.com
 Zoltan Kiss             zoltan.kiss@citrix.com
index fb7fb2f..dd40010 100644 (file)
@@ -1196,6 +1196,7 @@ read_cert_file(const char *file_name, X509 ***certs, size_t *n_certs)
             free(*certs);
             *certs = NULL;
             *n_certs = 0;
+            fclose(file);
             return EIO;
         }
 
index 13dfa68..a0b8f30 100644 (file)
@@ -540,6 +540,7 @@ query_db_string(const struct shash *all_dbs, const char *name,
                                         &db, &table, &column);
         if (retval) {
             ds_put_format(errors, "%s\n", retval);
+            free(retval);
             return NULL;
         }