diff options
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 4 |
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; } |