gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/plain


From: gsasl-commit
Subject: CVS gsasl/lib/plain
Date: Mon, 20 Dec 2004 04:16:03 +0100

Update of /home/cvs/gsasl/lib/plain
In directory dopio:/tmp/cvs-serv5261

Modified Files:
        server.c 
Log Message:
Fix mem leak.


--- /home/cvs/gsasl/lib/plain/server.c  2004/12/20 03:14:15     1.18
+++ /home/cvs/gsasl/lib/plain/server.c  2004/12/20 03:16:03     1.19
@@ -116,13 +116,19 @@
       gsasl_property_set (sctx, GSASL_PASSWORD, NULL);
       key = gsasl_property_get (sctx, GSASL_PASSWORD);
       if (!key)
-       return GSASL_NO_PASSWORD;
+       {
+         free (passprep);
+         return GSASL_NO_PASSWORD;
+       }
 
       /* FIXME: Specification is unclear on whether unassigned code
         points are allowed or not.  We don't allow them. */
       res = gsasl_saslprep (key, 0, &normkey, NULL);
       if (res != GSASL_OK)
-       return res;
+       {
+         free (passprep);
+         return res;
+       }
 
       if (strlen (passprep) == strlen (normkey) &&
          memcmp (normkey, passprep, strlen (normkey)) == 0)
@@ -131,6 +137,7 @@
        res = GSASL_AUTHENTICATION_ERROR;
       free (normkey);
     }
+  free (passprep);
 
   return res;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]