projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f20f4a7
)
logind: fix borked r check
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 9 May 2018 23:34:33 +0000
(
01:34
+0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 9 May 2018 23:37:49 +0000
(
01:37
+0200)
CID #
1390947
, #
1390952
.
src/login/logind.c
patch
|
blob
|
history
diff --git
a/src/login/logind.c
b/src/login/logind.c
index 385c9773995de9dc9a35815c50f1527078882c57..96f48cbd17f037ffb7dc6d76f198dd9227639704 100644
(file)
--- a/
src/login/logind.c
+++ b/
src/login/logind.c
@@
-389,14
+389,18
@@
static int parse_fdname(const char *fdname, char **session_id, dev_t *dev) {
if (!streq(parts[0], "session"))
return -EINVAL;
+
id = strdup(parts[1]);
if (!id)
return -ENOMEM;
if (!streq(parts[2], "device"))
return -EINVAL;
- r = safe_atou(parts[3], &major) ||
- safe_atou(parts[4], &minor);
+
+ r = safe_atou(parts[3], &major);
+ if (r < 0)
+ return r;
+ r = safe_atou(parts[4], &minor);
if (r < 0)
return r;