From 078f8a7a7be4850a7bf578adf8544d2f8763d669 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Fri, 14 May 2021 09:22:27 -0500 Subject: [PATCH] Dont free the kb_path twice. The functions calling g_strdup (kb_path) already take care of free()'ing the string, as well as delete once the kb is deleted. --- CHANGELOG.md | 1 + util/kb.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cadfa8c51..aae4476b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed ### Fixed - Unify GLib log domains [#479](https://github.com/greenbone/gvm-libs/pull/479) +- Fix double free. [#499](https://github.com/greenbone/gvm-libs/pull/499) ### Removed diff --git a/util/kb.c b/util/kb.c index 41937eee1..e5fd799e9 100644 --- a/util/kb.c +++ b/util/kb.c @@ -279,7 +279,6 @@ get_redis_ctx (struct kb_redis *kbr) kbr->rctx ? kbr->rctx->errstr : strerror (ENOMEM)); redisFree (kbr->rctx); kbr->rctx = NULL; - g_free (kbr->path); return -1; } @@ -289,7 +288,6 @@ get_redis_ctx (struct kb_redis *kbr) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, "No redis DB available"); redisFree (kbr->rctx); kbr->rctx = NULL; - g_free (kbr->path); return -2; }