Skip to contentSkip to conversation

Fix: modprobe.c: fix tmp_list memory leak

PATCH Jérémie Galarneau 1 participant 1 message May 6, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged in both master and stable-2.6, thanks!

Jérémie

Quoted 48 lines · Philippe Proulx
---
 src/bin/lttng-sessiond/modprobe.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
src/bin/lttng-sessiond/modprobe.c +4 -5
index d730a1d..32c4210 100644
@@ -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;
@@ -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 == ' ') {
--

2.3.0

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 3 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev