Commit a5559cbd authored by Pavel Emelyanov's avatar Pavel Emelyanov

plugins: Don't strdup libdir arg

It's not freed anywhere. Makes code look simpler.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 094affbd
......@@ -280,11 +280,7 @@ int main(int argc, char *argv[])
opts.check_ms_kernel = true;
break;
case 'L':
opts.libdir = strdup(optarg);
if (opts.libdir == NULL) {
pr_perror("Can't allocate memory");
return -1;
}
opts.libdir = optarg;
break;
case 'V':
pr_msg("Version: %s\n", CRIU_VERSION);
......
......@@ -183,16 +183,13 @@ int cr_plugin_init(void)
if (opts.libdir == NULL) {
path = getenv("CRIU_LIBS_DIR");
if (path) {
opts.libdir = strdup(path);
} else {
if (path)
opts.libdir = path;
else {
if (access(CR_PLUGIN_DEFAULT, F_OK))
return 0;
opts.libdir = strdup(CR_PLUGIN_DEFAULT);
}
if (opts.libdir == NULL) {
pr_perror("Can't allocate memory");
return -1;
opts.libdir = CR_PLUGIN_DEFAULT;
}
}
......
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