projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
796ba3b
)
hotplug: fix a memory leak in handle_button_complete()
author
Alexander Couzens
<lynxis@fe80.eu>
Sun, 11 Jun 2017 09:52:47 +0000
(11:52 +0200)
committer
Alexander Couzens
<lynxis@fe80.eu>
Sun, 11 Jun 2017 11:49:08 +0000
(13:49 +0200)
Found-by: Coverity Scan #1412460
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
plug/hotplug.c
patch
|
blob
|
history
diff --git
a/plug/hotplug.c
b/plug/hotplug.c
index c8bea1b75b958284968fd6663a8fcb0c9a9fab2a..ce29ced149cb245d9a0d94eb315461b962229364 100644
(file)
--- a/
plug/hotplug.c
+++ b/
plug/hotplug.c
@@
-431,8
+431,11
@@
static void handle_button_complete(struct blob_attr *msg, struct blob_attr *data
if (!timeout)
return;
+ if (!name)
+ return;
+
b = malloc(sizeof(*b));
- if (!b
|| !name
)
+ if (!b)
return;
memset(b, 0, sizeof(*b));