Skip to content

Commit

Permalink
Fix: modprobe.c: fix tmp_list memory leak
Browse files Browse the repository at this point in the history
Reported-by: Hannes Weisbach <hannes.weisbach@mailbox.tu-dresden.de>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
  • Loading branch information
eepp authored and jgalar committed May 6, 2015
1 parent 9ae17e2 commit 44603c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bin/lttng-sessiond/modprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,11 @@ static int append_list_to_probes(const char *list)
{
char *next;
int index = nr_probes, ret;
char *tmp_list;
char *tmp_list, *cur_list;

assert(list);

tmp_list = strdup(list);
cur_list = tmp_list = strdup(list);
if (!tmp_list) {
PERROR("strdup temp list");
return -ENOMEM;
Expand All @@ -374,11 +374,11 @@ static int append_list_to_probes(const char *list)
size_t name_len;
struct kern_modules_param *cur_mod;

next = strtok(tmp_list, ",");
next = strtok(cur_list, ",");
if (!next) {
break;
}
tmp_list = NULL;
cur_list = NULL;

/* filter leading spaces */
while (*next == ' ') {
Expand Down

0 comments on commit 44603c8

Please sign in to comment.