projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e15423
)
recv_common: fix memory leak and invalid free in error path
author
Andre Noll
<maan@systemlinux.org>
Sun, 11 Feb 2007 22:45:52 +0000
(23:45 +0100)
committer
Andre Noll
<maan@systemlinux.org>
Sun, 11 Feb 2007 22:45:52 +0000
(23:45 +0100)
As split_args() returns pointers that point within the given string,
it is wrong to free the individual pieces. However, the array of
substrings must be freed. parse_receiver_args() got both of these
wrong :(
recv_common.c
patch
|
blob
|
history
diff --git
a/recv_common.c
b/recv_common.c
index 8f8f63697714904c1d6c871c1e8e3df197e0298e..c14455d0ac760c6d3f4c5ea7aeba52ed4549a8b1 100644
(file)
--- a/
recv_common.c
+++ b/
recv_common.c
@@
-51,12
+51,7
@@
static void *parse_receiver_args(int receiver_num, char *options)
argv[1] = NULL;
}
conf = r->parse_config(argc, argv);
- if (!conf) {
- for (i = 0; i < argc; i++)
- free(argv[i]);
- free(argv);
- return NULL;
- }
+ free(argv);
return conf;
}