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:24:19 +0000 (09:24 -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 dab9d36..d7123e0 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -129,6 +129,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 d774619..d1d9c3f 100644 (file)
@@ -1195,6 +1195,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 a85a672..d85c4e1 100644 (file)
@@ -519,6 +519,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;
         }