]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: archive: Do not break on successful memory allocation
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2021 17:33:07 +0000 (17:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2021 17:33:07 +0000 (17:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c

index a0dce3f36fccfae30f9c81470f32edd7ef64e0e1..e303cf94024513afdcf415d8baefb71120f10023 100644 (file)
@@ -522,7 +522,7 @@ static int pakfire_archive_parse_entry_scriptlet(PakfireArchive archive,
        // Make space for the new scriptlet
        archive->scriptlets = realloc(archive->scriptlets,
                sizeof(*archive->scriptlets) * (archive->nscriptlets + 1));
-       if (archive->scriptlets) {
+       if (!archive->scriptlets) {
                pakfire_scriptlet_free(scriptlet);
                return -ENOMEM;
        }