Do not leak memory in sample server (#852755)

This commit is contained in:
Jakub Jelen 2015-03-03 14:27:51 +01:00
parent f85e1a3ecd
commit 48b97a8104
2 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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