projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
558ffb5
)
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
Daniel Golle
<daniel@makrotopia.org>
Tue, 20 Jun 2017 14:48:43 +0000
(16:48 +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));