changeset 35368:7e303b6aafca

Pass pointer to start of allocated memory to free, not something in the middle.
author reimar
date Fri, 23 Nov 2012 19:21:36 +0000
parents f1bd28a00384
children dac86d3464e2
files stream/cookies.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/cookies.c	Fri Nov 23 14:17:21 2012 +0000
+++ b/stream/cookies.c	Fri Nov 23 19:21:36 2012 +0000
@@ -160,9 +160,10 @@
 						  struct cookie_list_type
 						  *list)
 {
-    char *ptr;
+    char *ptr, *buffer;
     off_t length;
 
+    buffer =
     ptr = load_file(filename, &length);
     if (!ptr)
 	return list;
@@ -181,7 +182,7 @@
 	    list = new;
 	}
     }
-    free(ptr);
+    free(buffer);
     return list;
 }