]> git.ipfire.org Git - location/libloc.git/commitdiff
database: Initialize r on create
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Aug 2022 13:15:40 +0000 (13:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Aug 2022 13:15:40 +0000 (13:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index 419794e6450f559240fc255b53540ca21f9c8e0a..be60aa468f4afdf9fc77682d731c4d2529cc3906 100644 (file)
@@ -480,7 +480,7 @@ static void loc_database_free(struct loc_database* db) {
 
 LOC_EXPORT int loc_database_new(struct loc_ctx* ctx, struct loc_database** database, FILE* f) {
        struct loc_database* db = NULL;
-       int r;
+       int r = 1;
 
        // Fail on invalid file handle
        if (!f) {