[pacman-dev] [PATCH 1/2] version: fix memory leak in early return
Dave Reisner
dreisner at archlinux.org
Tue Nov 18 14:02:05 UTC 2014
---
lib/libalpm/version.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c
index 0048167..6d68aac 100644
--- a/lib/libalpm/version.c
+++ b/lib/libalpm/version.c
@@ -109,7 +109,8 @@ static int rpmvercmp(const char *a, const char *b)
/* If the separator lengths were different, we are also finished */
if ((one - ptr1) != (two - ptr2)) {
- return (one - ptr1) < (two - ptr2) ? -1 : 1;
+ ret = (one - ptr1) < (two - ptr2) ? -1 : 1;
+ goto cleanup;
}
ptr1 = one;
--
2.1.3
More information about the pacman-dev
mailing list