Commit b4fc49a9 authored by Federico G. Schwindt's avatar Federico G. Schwindt

On error free any allocated resources

Spotted by coverity.
parent 94b70875
......@@ -34,6 +34,7 @@
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
......@@ -89,8 +90,10 @@ VIN_n_Arg(const char *n_arg, char **name, char **dir)
}
if (dir != NULL) {
*dir = strdup(dn);
if (*dir == NULL)
if (*dir == NULL) {
free(*name);
return (-1);
}
}
return (0);
}
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