diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-11 12:30:32 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-11 12:30:32 +0100 |
commit | e16ab3b5bb0168f352598526f69430ee500cb6ac (patch) | |
tree | 0e08d8d4733344f3a757edf8d3ed7441f453ded1 | |
parent | m + split out save_fbs to main + do not use PATH_MAX + do not use alloca (diff) | |
download | scrotty-e16ab3b5bb0168f352598526f69430ee500cb6ac.tar.gz scrotty-e16ab3b5bb0168f352598526f69430ee500cb6ac.tar.bz2 scrotty-e16ab3b5bb0168f352598526f69430ee500cb6ac.tar.xz |
fix a memory leak
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/scrotty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scrotty.c b/src/scrotty.c index 5c7379d..5624e28 100644 --- a/src/scrotty.c +++ b/src/scrotty.c @@ -388,7 +388,7 @@ save_fb (int fbno, int raw, const char *filepattern, const char *execpattern) /* Should we run a command over the image? */ if (execpattern == NULL) - return 0; + goto done; /* Get execute arguments. */ execargs = evaluate (execpattern, fbno, width, height, imgpath); @@ -399,12 +399,12 @@ save_fb (int fbno, int raw, const char *filepattern, const char *execpattern) if (exec_image (execargs) < 0) goto fail; - goto cleanup; + goto done; fail: saved_errno = errno; rc = -1; - cleanup: + done: free (execargs); if (imgpath != imgpath_) free (imgpath); |