summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-12 12:15:49 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:54 -0400
commitb47d419c25ecc735615a1088060c1ec8bef1e41f (patch)
tree13940040841fbec3a928f82426390654e4b50fcc /src/shared/util.c
parent7ff7394d9e4e9189c30fd018235e6b1728c6f2d0 (diff)
Modernization
Fixes minor leak in error path in device.c.
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index e18421e520..54dbace193 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -643,7 +643,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
/* Kernel threads have no argv[] */
if (r == NULL || r[0] == 0) {
- char *t;
+ _cleanup_free_ char *t = NULL;
int h;
free(r);
@@ -656,8 +656,6 @@ int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char *
return h;
r = strjoin("[", t, "]", NULL);
- free(t);
-
if (!r)
return -ENOMEM;
}