From a0a96cee0a9d85ec2175b9597d89f8cc2e9d0b55 Mon Sep 17 00:00:00 2001 From: yinpeijun Date: Mon, 28 Jul 2014 15:21:17 +0800 Subject: [PATCH] Fix two memory leaks. Found by coverity. Signed-off-by: yinpeijun Signed-off-by: Ben Pfaff --- AUTHORS | 1 + lib/stream-ssl.c | 1 + ovsdb/ovsdb-server.c | 1 + 3 files changed, 3 insertions(+) diff --git a/AUTHORS b/AUTHORS index 3b8cc8cc7..69a854cf8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -103,6 +103,7 @@ Valient Gough vgough@pobox.com Vivien Bernet-Rollande vbr@soprive.net Wei Yongjun yjwei@cn.fujitsu.com 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 diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index cd4783ca9..79fa322a0 100644 --- a/lib/stream-ssl.c +++ b/lib/stream-ssl.c @@ -1153,6 +1153,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; } diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index f64122eb1..9a66d7985 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -475,6 +475,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; } -- 2.20.1