]> granicus.if.org Git - curl/commitdiff
dict: fix memory leak in OOM exit path
authorArvid Norberg <arvid@cs.umu.se>
Fri, 14 Feb 2014 07:20:59 +0000 (08:20 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 Feb 2014 07:21:41 +0000 (08:21 +0100)
Bug: https://github.com/bagder/curl/pull/90

lib/dict.c

index f5c892197fb28d03f3517831dea9e5bc34ad8a58..86ddfb9e2a1606721eac3909829ef1b5925bc575 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -122,9 +122,8 @@ static char *unescape_word(struct SessionHandle *data, const char *inputbuff)
       dictp[olen++] = byte;
     }
     dictp[olen]=0;
-
-    free(newp);
   }
+  free(newp);
   return dictp;
 }