projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69b8a8e
)
service: fix memory leak in service_add_fd_store()
author
reverendhomer
<mk.43.ecko@gmail.com>
Wed, 7 Oct 2015 08:55:31 +0000
(11:55 +0300)
committer
reverendhomer
<mk.43.ecko@gmail.com>
Wed, 7 Oct 2015 08:55:31 +0000
(11:55 +0300)
fixes Coverity #1325767
src/core/service.c
patch
|
blob
|
history
diff --git
a/src/core/service.c
b/src/core/service.c
index
8c33976
..
ce3b813
100644
(file)
--- a/
src/core/service.c
+++ b/
src/core/service.c
@@
-363,8
+363,10
@@
static int service_add_fd_store(Service *s, int fd, const char *name) {
fs->fd = fd;
fs->service = s;
fs->fdname = strdup(name ?: "stored");
- if (!fs->fdname)
+ if (!fs->fdname) {
+ free(fs);
return -ENOMEM;
+ }
r = sd_event_add_io(UNIT(s)->manager->event, &fs->event_source, fd, 0, on_fd_store_io, fs);
if (r < 0) {