diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-12 00:17:20 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-12 00:17:20 +0100 |
| commit | ec4ee45678679fd1a2b64bebe59b0612eaff2d6e (patch) | |
| tree | 071bf3c714a1873f559793fa4d97fb688414ea3a | |
| parent | cleanup (diff) | |
| download | blind-ec4ee45678679fd1a2b64bebe59b0612eaff2d6e.tar.gz blind-ec4ee45678679fd1a2b64bebe59b0612eaff2d6e.tar.bz2 blind-ec4ee45678679fd1a2b64bebe59b0612eaff2d6e.tar.xz | |
Free all allocations at end + use calloc instead of memset
Signed-off-by: Mattias Andrée <maandree@kth.se>
| -rw-r--r-- | src/vu-concat.c | 2 | ||||
| -rw-r--r-- | src/vu-crop.c | 2 | ||||
| -rw-r--r-- | src/vu-extend.c | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/vu-concat.c b/src/vu-concat.c index 08832fa..d71674f 100644 --- a/src/vu-concat.c +++ b/src/vu-concat.c @@ -39,6 +39,8 @@ concat_to_stdout(int argc, char *argv[]) ewriteall(STDOUT_FILENO, streams->buf, streams->ptr, "<stdout>"); close(streams->fd); } + + free(streams); } static void diff --git a/src/vu-crop.c b/src/vu-crop.c index 68b1724..bf5a930 100644 --- a/src/vu-crop.c +++ b/src/vu-crop.c @@ -80,5 +80,7 @@ main(int argc, char *argv[]) ewriteall(STDOUT_FILENO, image, m, "<stdout>"); } + free(buf); + free(image); return 0; } diff --git a/src/vu-extend.c b/src/vu-extend.c index 0c65bf6..71be7f0 100644 --- a/src/vu-extend.c +++ b/src/vu-extend.c @@ -64,10 +64,7 @@ main(int argc, char *argv[]) imgh += bottom; echeck_frame_size(imgw, imgh, stream.pixel_size, "output", "<stdout>"); m = imgh * (imgw *= stream.pixel_size); - image = emalloc(m); - - if (!tile) - memset(image, 0, m); + image = tile ? emalloc(m) : ecalloc(1, m); stream.width += left + right; h = stream.height += top + bottom; @@ -100,5 +97,7 @@ main(int argc, char *argv[]) ewriteall(STDOUT_FILENO, image, m, "<stdout>"); } + free(buf); + free(image); return 0; } |
