Skip to content

Commit

Permalink
Coverity reports memory leak in contrail-common/http_curl.cc
Browse files Browse the repository at this point in the history
I have run Coverity on branch R5.0 and it reported the following
memory leak in contrail-common/http_curl.cc:

- leaked_storage: Variable conn going out of scope leaks the storage
it points to in http_curl.cc:new_conn()
Indeed, conn should be freed if the following condition is matched:
if ( !conn->easy ) {

Change-Id: Idf4985d7806897c0f8eb7e725e19259a4adfa809
Closes-Bug: #1770601
Signed-off-by: Anda Nicolae <anicolae@lenovo.com>
  • Loading branch information
Anda Nicolae committed May 14, 2018
1 parent bb11963 commit 09f32f4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http/client/http_curl.cc
Expand Up @@ -389,6 +389,7 @@ ConnInfo *new_conn(HttpConnection *connection, GlobalInfo *g,
conn->easy = curl_easy_init();

if ( !conn->easy ) {
free(conn);
return NULL;
}
conn->global = g;
Expand Down

0 comments on commit 09f32f4

Please sign in to comment.