Commit e773852f authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Free temp VSM structure when finished with it in n_arg_sock

Spotted by: Coverity
parent 7b18d9a0
......@@ -387,17 +387,21 @@ n_arg_sock(const char *n_arg)
struct VSM_fantom vt;
vsm = VSM_New();
AN(vsm);
if (VSM_n_Arg(vsm, n_arg) < 0) {
fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm);
return (-1);
}
if (VSM_Open(vsm)) {
fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm);
return (-1);
}
if (!VSM_Get(vsm, &vt, "Arg", "-T", "")) {
fprintf(stderr, "No -T arg in shared memory\n");
VSM_Delete(vsm);
return (-1);
}
AN(vt.b);
......@@ -408,6 +412,8 @@ n_arg_sock(const char *n_arg)
S_arg = strdup(vt.b);
}
VSM_Delete(vsm);
sock = -1;
while (*T_arg) {
p = strchr(T_arg, '\n');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment