projects
/
profile
/
ivi
/
murphy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08c0ae6
)
common: fixed a possible NULL pointer dereference in process tracking.
author
Ismo Puustinen
<ismo.puustinen@intel.com>
Tue, 15 Oct 2013 10:17:53 +0000
(13:17 +0300)
committer
Ismo Puustinen
<ismo.puustinen@intel.com>
Tue, 15 Oct 2013 11:57:39 +0000
(14:57 +0300)
src/common/process.c
patch
|
blob
|
history
diff --git
a/src/common/process.c
b/src/common/process.c
index
840480d
..
6f3d196
100644
(file)
--- a/
src/common/process.c
+++ b/
src/common/process.c
@@
-917,12
+917,18
@@
mrp_pid_watch_t *mrp_pid_set_watch(pid_t pid, mrp_mainloop_t *ml,
goto error;
}
- mrp_list_init(&client->hook);
client->cb = cb;
client->user_data = userdata;
client->w = (mrp_pid_watch_t *) mrp_allocz(sizeof(mrp_pid_watch_t));
+
+ if (!client->w) {
+ mrp_free(nl_w);
+ goto error;
+ }
+
client->w->pid = pid;
+ mrp_list_init(&client->hook);
mrp_list_append(&nl_w->clients, &client->hook);
nl_w->n_clients++;