database: Fix use-after-free error after last iteration of search
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Oct 2019 18:38:14 +0000 (18:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Oct 2019 18:38:14 +0000 (18:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index f986479..6484345 100644 (file)
@@ -688,6 +688,7 @@ LOC_EXPORT int loc_database_enumerator_next_as(
 
                // No match
                loc_as_unref(*as);
+               *as = NULL;
        }
 
        // Reset the index