diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-12-04 00:14:37 +0100 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-12-04 00:15:02 +0100 |
commit | 652212b0c2b60b9ef9b2e24eae82401f880fa21a (patch) | |
tree | ef7f5248632df9c3b88dc527d92c60cc5d0330fc /src/systemctl/systemctl.c | |
parent | f08c4c08c7c2ce0fdfb4cf49642b00fbfb15185f (diff) |
systemctl: fix a leak
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r-- | src/systemctl/systemctl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 74af772794..c60bab4b6d 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5753,8 +5753,11 @@ static int create_edit_temp_file(const char *new_path, const char *original_path return log_oom(); r = mkdir_parents(new_path, 0755); - if (r < 0) - return log_error_errno(r, "Failed to create directories for %s: %m", new_path); + if (r < 0) { + log_error_errno(r, "Failed to create directories for %s: %m", new_path); + free(t); + return r; + } r = copy_file(original_path, t, 0, 0644); if (r == -ENOENT) { |