[cyrus-sasl] Do not leak memory in sample server (#852755)

Jakub Jelen jjelen at fedoraproject.org
Fri Mar 13 16:27:02 UTC 2015


commit 48b97a810489fab31e3b73db15245b1596275b07
Author: Jakub Jelen <jjelen at redhat.com>
Date:   Tue Mar 3 14:27:51 2015 +0100

    Do not leak memory in sample server (#852755)

 cyrus-sasl-2.1.26-sample-leak.patch | 13 +++++++++++++
 cyrus-sasl.spec                     |  3 +++
 2 files changed, 16 insertions(+)
---
diff --git a/cyrus-sasl-2.1.26-sample-leak.patch b/cyrus-sasl-2.1.26-sample-leak.patch
new file mode 100644
index 0000000..9f79164
--- /dev/null
+++ b/cyrus-sasl-2.1.26-sample-leak.patch
@@ -0,0 +1,13 @@
+diff --git a/sample/server.c b/sample/server.c
+index f5aff68..6c684af 100644
+--- a/sample/server.c
++++ b/sample/server.c
+@@ -227,6 +227,8 @@ int mysasl_negotiate(FILE *in, FILE *out, sasl_conn_t *conn)
+ 
+     /* send capability list to client */
+     send_string(out, data, len);
++    if (mech)
++		free(data);
+ 
+     dprintf(1, "waiting for client mechanism...\n");
+     len = recv_string(in, chosenmech, sizeof chosenmech);
diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec
index a564bd5..1419f4b 100644
--- a/cyrus-sasl.spec
+++ b/cyrus-sasl.spec
@@ -54,6 +54,8 @@ Patch51: cyrus-sasl-2.1.26-sql.patch
 Patch52: cyrus-sasl-2.1.26-config-error.patch
 # Treat SCRAM-SHA-1/DIGEST-MD5 as more secure than PLAIN (#970718)
 Patch53: cyrus-sasl-2.1.26-prefer-SCRAM-SHA-1-over-PLAIN.patch
+# Do not leak memory in sample server (#852755)
+Patch54: cyrus-sasl-2.1.26-sample-leak.patch
 
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf, automake, libtool, gdbm-devel, groff
@@ -198,6 +200,7 @@ chmod -x include/*.h
 %patch51 -p1 -b .sql
 %patch52 -p1 -b .configerr
 %patch53 -p1 -b .sha1vsplain
+%patch54 -p1 -b .leak
 
 
 %build


More information about the scm-commits mailing list