diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-22 21:14:21 -0200 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-24 19:30:30 -0200 |
| commit | 44f12f209f7019c0abbec0f919cb18a136cd7bee (patch) | |
| tree | 68eb68f5f5655eb8de51b4ebbde386500bd0b51b /tools/start-stop-daemon.c | |
| parent | a1d6bbb1f30d638a039db2b5e5ef3ea542590b62 (diff) | |
*: fix coverity warnings - resource leaks
These are mostly trivial fixes for leaks in the error path of some functions.
The changes in bgpd/bgp_mpath.c deserves a bit of explanation though. In
the bgp_info_mpath_aggregate_update() function, we were allocating memory
for the lcomm variable but doing nothing with it. Since the code for
communities, extended communities and large communities is pretty much
the same in this function, it's clear that this was a copy and paste
error where most of the ext. community code was copied but not all of
it as it should have been.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'tools/start-stop-daemon.c')
| -rw-r--r-- | tools/start-stop-daemon.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c index 30dc6484ae..8dc16f4209 100644 --- a/tools/start-stop-daemon.c +++ b/tools/start-stop-daemon.c @@ -538,10 +538,7 @@ static void parse_options(int argc, char *const *argv) execname = optarg; break; case 'c': /* --chuid <username>|<uid> */ - /* we copy the string just in case we need the - * argument later. */ - changeuser = strdup(optarg); - changeuser = strtok(changeuser, ":"); + changeuser = strtok(optarg, ":"); changegroup = strtok(NULL, ":"); break; case 'r': /* --chroot /new/root */ |
