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[]) ...@@ -280,11 +280,7 @@ int main(int argc, char *argv[])
opts.check_ms_kernel = true; opts.check_ms_kernel = true;
break; break;
case 'L': case 'L':
opts.libdir = strdup(optarg); opts.libdir = optarg;
if (opts.libdir == NULL) {
pr_perror("Can't allocate memory");
return -1;
}
break; break;
case 'V': case 'V':
pr_msg("Version: %s\n", CRIU_VERSION); pr_msg("Version: %s\n", CRIU_VERSION);
......
...@@ -183,16 +183,13 @@ int cr_plugin_init(void) ...@@ -183,16 +183,13 @@ int cr_plugin_init(void)
if (opts.libdir == NULL) { if (opts.libdir == NULL) {
path = getenv("CRIU_LIBS_DIR"); path = getenv("CRIU_LIBS_DIR");
if (path) { if (path)
opts.libdir = strdup(path); opts.libdir = path;
} else { else {
if (access(CR_PLUGIN_DEFAULT, F_OK)) if (access(CR_PLUGIN_DEFAULT, F_OK))
return 0; return 0;
opts.libdir = strdup(CR_PLUGIN_DEFAULT);
} opts.libdir = CR_PLUGIN_DEFAULT;
if (opts.libdir == NULL) {
pr_perror("Can't allocate memory");
return -1;
} }
} }
......
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