summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-26 14:17:54 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-26 14:17:54 -0800
commit42db44510d6e58120a9f0d272f5de2b26fb09ba7 (patch)
treeef80504cccd586cfbdb881dc3c31a883228cc965 /core
parentda1d6e97f63e53f26b92c6709fed6423070e10c9 (diff)
downloadsubsurface-42db44510d6e58120a9f0d272f5de2b26fb09ba7.tar.gz
Cleanup: avoid memory leak
Coverity CID 208333 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/save-git.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/save-git.c b/core/save-git.c
index 27051ec39..e5ff5378b 100644
--- a/core/save-git.c
+++ b/core/save-git.c
@@ -1099,7 +1099,9 @@ static void create_commit_message(struct membuffer *msg, bool create_empty)
} while ((dc = dc->next) != NULL);
put_format(msg, "\n");
}
- put_format(msg, "Created by %s\n", subsurface_user_agent());
+ const char *user_agent = subsurface_user_agent();
+ put_format(msg, "Created by %s\n", user_agent);
+ free((void *)user_agent);
}
static int create_new_commit(git_repository *repo, const char *remote, const char *branch, git_oid *tree_id, bool create_empty)