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:
8301aa0
)
dynamic-user: fix potential segfault
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 27 Aug 2018 20:09:00 +0000
(
05:09
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Mon, 27 Aug 2018 20:09:00 +0000
(
05:09
+0900)
src/core/dynamic-user.c
patch
|
blob
|
history
diff --git
a/src/core/dynamic-user.c
b/src/core/dynamic-user.c
index
b3b197b
..
824ad06
100644
(file)
--- a/
src/core/dynamic-user.c
+++ b/
src/core/dynamic-user.c
@@
-104,9
+104,11
@@
static int dynamic_user_acquire(Manager *m, const char *name, DynamicUser** ret)
d = hashmap_get(m->dynamic_users, name);
if (d) {
- /* We already have a structure for the dynamic user, let's increase the ref count and reuse it */
- d->n_ref++;
- *ret = d;
+ if (ret) {
+ /* We already have a structure for the dynamic user, let's increase the ref count and reuse it */
+ d->n_ref++;
+ *ret = d;
+ }
return 0;
}