From 3519f493ce51bac53d178f7ff9e5b84ca98a158a Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Fri, 19 Aug 2016 14:59:26 +0200 Subject: [PATCH] cr_lock_repo: Fix segfault caused by freed tmp_repodata_dir variable --- src/createrepo_shared.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c index 5872029..d4df86c 100644 --- a/src/createrepo_shared.c +++ b/src/createrepo_shared.c @@ -258,12 +258,11 @@ cr_lock_repo(const gchar *repo_dir, g_debug("(--ignore-lock enabled) For data generation is used: %s", tmp_repodata_dir); } - } - if (tmp_repodata_dir) *tmp_repodata_dir_p = g_strdup(tmp_repodata_dir); - else + } else { *tmp_repodata_dir_p = g_strdup(lock_dir); + } return TRUE; } -- 2.7.4