Reported-by: Coverity (1395614) Resource leak
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
worker->procname = strdup(procname);
if (!worker->procname) {
ret = -ENOMEM;
- goto end;
+ goto error_procname_alloc;
}
/* Create unix socket. */
if (lttcomm_create_anon_unix_socketpair(worker->sockpair) < 0) {
worker->sockpair[i] = -1;
}
error_sock:
+ free(worker->procname);
+error_procname_alloc:
free(worker);
return ret;
}