From: Sebastian Harl Date: Wed, 25 Feb 2015 09:39:34 +0000 (+0100) Subject: frontend: Fix a memory leak in an error condition in FETCH. X-Git-Tag: sysdb-0.8.0~166 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e3dd1869ac2397272179eb1f0229175a27dc7b06;p=sysdb.git frontend: Fix a memory leak in an error condition in FETCH. --- diff --git a/src/frontend/query.c b/src/frontend/query.c index cc107c6..2bd234a 100644 --- a/src/frontend/query.c +++ b/src/frontend/query.c @@ -331,10 +331,14 @@ sdb_fe_exec_fetch(sdb_conn_t *conn, int type, sdb_strbuf_sprintf(conn->errbuf, "Failed to fetch %s %s.%s: " "%s not found", SDB_STORE_TYPE_TO_NAME(type), hostname, name, name); + if (obj) + sdb_object_deref(SDB_OBJ(obj)); + sdb_object_deref(SDB_OBJ(host)); return -1; } sdb_object_deref(SDB_OBJ(host)); } + host = NULL; buf = sdb_strbuf_create(1024); if (! buf) {