shared/vpick: use strdup_to where appropriate

This commit is contained in:
Mike Yuan
2024-04-20 07:16:00 +08:00
parent bf49f3bb44
commit 164f3d8f3d
+3 -5
View File
@@ -185,11 +185,9 @@ static int pin_choice(
if (!result.path)
return log_oom_debug();
if (filter->version) {
result.version = strdup(filter->version);
if (!result.version)
return log_oom_debug();
}
r = strdup_to(&result.version, filter->version);
if (r < 0)
return r;
*ret = TAKE_PICK_RESULT(result);
return 1;