Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ipsec-tools/src/racoon PR/50918: David Binderman...



details:   https://anonhg.NetBSD.org/src/rev/07711a65d6e2
branches:  trunk
changeset: 814150:07711a65d6e2
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Mar 09 15:58:25 2016 +0000

description:
PR/50918: David Binderman: Fix memory leak

diffstat:

 crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r d5f4dd532d29 -r 07711a65d6e2 crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c
--- a/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c Wed Mar 09 15:45:37 2016 +0000
+++ b/crypto/dist/ipsec-tools/src/racoon/isakmp_xauth.c Wed Mar 09 15:58:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isakmp_xauth.c,v 1.27 2014/03/18 18:20:35 riastradh Exp $      */
+/*     $NetBSD: isakmp_xauth.c,v 1.28 2016/03/09 15:58:25 christos Exp $       */
 
 /* Id: isakmp_xauth.c,v 1.38 2006/08/22 18:17:17 manubsd Exp */
 
@@ -1803,7 +1803,7 @@
                new = racoon_malloc(sizeof(*new));
                if (new == NULL) {
                        plog(LLV_ERROR, LOCATION, NULL, 
-                           "xauth_rmconf_dup: malloc failed\n");
+                           "%s: malloc failed\n", __func__);
                        return NULL;
                }
 
@@ -1813,16 +1813,16 @@
                        new->login = vdup(xauth_rmconf->login);
                        if (new->login == NULL) {
                                plog(LLV_ERROR, LOCATION, NULL, 
-                                   "xauth_rmconf_dup: malloc failed (login)\n");
-                               return NULL;
+                                   "%s: malloc failed (login)\n", __func__);
+                               goto out;
                        }
                }
                if (xauth_rmconf->pass != NULL) {
                        new->pass = vdup(xauth_rmconf->pass);
                        if (new->pass == NULL) {
                                plog(LLV_ERROR, LOCATION, NULL, 
-                                   "xauth_rmconf_dup: malloc failed (password)\n");
-                               return NULL;
+                                   "%s: malloc failed (password)\n", __func__);
+                               goto out;
                        }
                }
 
@@ -1830,4 +1830,8 @@
        }
 
        return NULL;
+out:
+       vfree(new->login);
+       racoon_free(new);
+       return NULL;
 }



Home | Main Index | Thread Index | Old Index