projects
/
zchunk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13b0e4d
)
Fix memory leak and off-by-one allocation error
author
Jonathan Dieter
<jdieter@gmail.com>
Thu, 24 Jan 2019 19:44:06 +0000
(19:44 +0000)
committer
Jonathan Dieter
<jdieter@gmail.com>
Thu, 24 Jan 2019 19:44:06 +0000
(19:44 +0000)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
test/copy_chunks.c
patch
|
blob
|
history
diff --git
a/test/copy_chunks.c
b/test/copy_chunks.c
index f5d78c88aab9cf4d0f035af6962c6d2143332937..b8d5b9fe5087ff273b102e98c0ffa9ddeac5ad21 100644
(file)
--- a/
test/copy_chunks.c
+++ b/
test/copy_chunks.c
@@
-40,7
+40,7
@@
int main (int argc, char *argv[]) {
zck_set_log_level(ZCK_LOG_DEBUG);
- char *path = zmalloc(strlen(argv[1]));
+ char *path = zmalloc(strlen(argv[1])
+1
);
strcpy(path, argv[1]);
char *base_name = basename(path);
@@
-117,5
+117,6
@@
int main (int argc, char *argv[]) {
zck_free(&tgt_zck);
zck_free(&src_zck);
+ free(path);
return 0;
}