From: Michael Tremer Date: Sat, 11 Jan 2025 18:44:38 +0000 (+0000) Subject: snapshots: Return pointer without touching the reference counter X-Git-Tag: 0.9.30~418 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03e55be10010ecb6292be025c45b544af37a1fa3;p=pakfire.git snapshots: Return pointer without touching the reference counter Hopefully this will make the static analyzer happier. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index f3df0fdf1..e1a238c40 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -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; }