Make tests pass and introduce a memory leak

Since 37fbafcd92 the tests hasn't worked
since a string on the stack was added as version for a virtual package.
Instead create the version string on the heap and then simply leak it.
A short running program as apk shouldn't need to worry about memory
leaks.
cute-signatures
Fredrik Gustafsson 2019-11-11 19:02:04 +01:00 committed by Natanael Copa
parent c635c04669
commit f8d5aa58f9
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ static struct apk_package *create_virtual_package(struct apk_database *db, struc
if (virtpkg == NULL) return 0;
virtpkg->name = name;
virtpkg->version = apk_blob_atomize(APK_BLOB_STR(ver));
virtpkg->version = apk_blob_atomize_dup(APK_BLOB_STR(ver));
virtpkg->description = strdup("virtual meta package");
virtpkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));