Blame SOURCES/0001-Fix-a-memory-leak-on-the-error-path-in-XpGetLocaleNe.patch

5436ff
From a1e1a7b0b9a7bcededfc9166df58541675615699 Mon Sep 17 00:00:00 2001
5436ff
From: Adam Jackson <ajax@redhat.com>
5436ff
Date: Tue, 16 Oct 2018 12:39:26 -0400
5436ff
Subject: [PATCH] Fix a memory leak on the error path in XpGetLocaleNetString
5436ff
5436ff
After Data() we own the pointer again, so we can just free it before
5436ff
getting the reply.
5436ff
5436ff
Signed-off-by: Adam Jackson <ajax@redhat.com>
5436ff
---
5436ff
 src/XpPrinter.c | 4 ++--
5436ff
 1 file changed, 2 insertions(+), 2 deletions(-)
5436ff
5436ff
diff --git a/src/XpPrinter.c b/src/XpPrinter.c
5436ff
index 03b18c4..4e8cdc9 100644
5436ff
--- a/src/XpPrinter.c
5436ff
+++ b/src/XpPrinter.c
5436ff
@@ -118,14 +118,14 @@ XpGetPrinterList (
5436ff
     if (req->localeLen)
5436ff
 	Data( dpy, (char *) locale, (long) req->localeLen );
5436ff
 
5436ff
+    XFree(locale);
5436ff
+
5436ff
     if (! _XReply (dpy, (xReply *) &rep, 0, xFalse)) {
5436ff
         UnlockDisplay(dpy);
5436ff
         SyncHandle();
5436ff
         return ( (XPPrinterList) NULL ); /* error */
5436ff
     }
5436ff
 
5436ff
-    XFree(locale);
5436ff
-
5436ff
     *list_count = rep.listCount;
5436ff
 
5436ff
     if (*list_count) {
5436ff
-- 
5436ff
2.19.0
5436ff