dynamic-user: fix potential segfault
This commit is contained in:
parent
8301aa0bf1
commit
288ca7af8c
|
@ -104,9 +104,11 @@ static int dynamic_user_acquire(Manager *m, const char *name, DynamicUser** ret)
|
||||||
|
|
||||||
d = hashmap_get(m->dynamic_users, name);
|
d = hashmap_get(m->dynamic_users, name);
|
||||||
if (d) {
|
if (d) {
|
||||||
/* We already have a structure for the dynamic user, let's increase the ref count and reuse it */
|
if (ret) {
|
||||||
d->n_ref++;
|
/* We already have a structure for the dynamic user, let's increase the ref count and reuse it */
|
||||||
*ret = d;
|
d->n_ref++;
|
||||||
|
*ret = d;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue