aboutsummaryrefslogtreecommitdiff
path: root/handle_event.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-04-24 21:33:16 +0200
committerPetr Machata <pmachata@redhat.com>2012-04-24 21:33:16 +0200
commitfd2641c0d27705c89d224e3205b1296110b6598c (patch)
treecea0bbca30aaef8fe104893a5ac8b12f1522c52a /handle_event.c
parent8ead1cde21252e779f29ee4bcd68ae4a1bc86ed9 (diff)
downloadltrace-fd2641c0d27705c89d224e3205b1296110b6598c.tar.gz
Fix double frees, remove_process now releases memory
Presence in singly-linked list strongly indicates that process is heap allocated, and that if we are about to stop tracing it, we should also reclaim the memory.
Diffstat (limited to 'handle_event.c')
-rw-r--r--handle_event.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/handle_event.c b/handle_event.c
index 5de61a6..7648248 100644
--- a/handle_event.c
+++ b/handle_event.c
@@ -374,7 +374,6 @@ handle_exit(Event *event) {
event->e_un.ret_val);
}
remove_process(event->proc);
- free(event->proc);
}
static void
@@ -385,7 +384,6 @@ handle_exit_signal(Event *event) {
shortsignal(event->proc, event->e_un.signum));
}
remove_process(event->proc);
- free(event->proc);
}
static void
@@ -438,7 +436,6 @@ handle_exec(Event * event) {
untrace:
untrace_pid(pid);
remove_process(proc);
- free(proc);
return;
}
output_line(proc, "--- Called exec() ---");