]> git.ipfire.org Git - pakfire.git/commitdiff
snapshots: Return pointer without touching the reference counter
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:44:38 +0000 (18:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:44:38 +0000 (18:44 +0000)
Hopefully this will make the static analyzer happier.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/snapshot.c

index f3df0fdf1909b8910493f6880e9c38a17ea1e9a8..e1a238c405ee886dcae3b100000c6d9cebb6bae7 100644 (file)
@@ -113,11 +113,11 @@ int pakfire_snapshot_create(
        }
 
        // Return the snapshot
-       *snapshot = pakfire_snapshot_ref(s);
+       *snapshot = s;
+       return 0;
 
 ERROR:
-       if (s)
-               pakfire_snapshot_unref(s);
+       pakfire_snapshot_free(s);
 
        return r;
 }