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

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