]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/11/21 15:51:24
authormouring <mouring>
Thu, 6 Dec 2001 16:41:41 +0000 (16:41 +0000)
committermouring <mouring>
Thu, 6 Dec 2001 16:41:41 +0000 (16:41 +0000)
     [key.c]
     mem leak

ChangeLog
key.c

index a382e546ad0a2efcbaa026a5530962e567c06890..53b032d1b1f975829f56ef13934018a468193b77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
      [deattack.c radix.c]
      kill more registers
      millert@ ok
+   - markus@cvs.openbsd.org 2001/11/21 15:51:24
+     [key.c]
+     mem leak
 
 20011126
  - (tim) [contrib/cygwin/README, openbsd-compat/bsd-cygwin_util.c,
diff --git a/key.c b/key.c
index 57df5b93aef7ae9015572cf93dcb89eaf0e1d29b..220c476cd0964526e71fe02e708061fe5d15fa45 100644 (file)
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.33 2001/10/04 14:34:16 markus Exp $");
+RCSID("$OpenBSD: key.c,v 1.34 2001/11/21 15:51:24 markus Exp $");
 
 #include <openssl/evp.h>
 
@@ -420,14 +420,15 @@ key_read(Key *ret, char **cpp)
                n = uudecode(cp, blob, len);
                if (n < 0) {
                        error("key_read: uudecode %s failed", cp);
+                       xfree(blob);
                        return -1;
                }
                k = key_from_blob(blob, n);
+               xfree(blob);
                if (k == NULL) {
                        error("key_read: key_from_blob %s failed", cp);
                        return -1;
                }
-               xfree(blob);
                if (k->type != type) {
                        error("key_read: type mismatch: encoding error");
                        key_free(k);
@@ -454,9 +455,9 @@ key_read(Key *ret, char **cpp)
 #endif
                }
 /*XXXX*/
+               key_free(k);
                if (success != 1)
                        break;
-               key_free(k);
                /* advance cp: skip whitespace and data */
                while (*cp == ' ' || *cp == '\t')
                        cp++;
This page took 0.060172 seconds and 5 git commands to generate.