summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-11-18 09:02:05 -0500
committerAllan McRae <allan@archlinux.org>2014-11-19 14:14:04 +1000
commitef0577e3d5560c2d7f2869586219040beffdbb6b (patch)
treefe0bb952dfe84447449cf8781047eca70c651979 /lib/libalpm
parent3446453c72b7fea6e07d0e1f5a547a870bf60484 (diff)
downloadpacman-ef0577e3d5560c2d7f2869586219040beffdbb6b.tar.xz
version: fix memory leak in early return
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/version.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c
index 00481677..6d68aacd 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;