summaryrefslogtreecommitdiff
blob: 3be3495cbdc893befc9a9bf1e3603d5e3a45d98b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -ur knocker-0.7.1/src/knocker_conf.c knocker-0.7.1.new/src/knocker_conf.c
--- knocker-0.7.1/src/knocker_conf.c	2002-05-24 01:58:45.000000000 +0200
+++ knocker-0.7.1.new/src/knocker_conf.c	2007-07-15 02:14:17.000000000 +0200
@@ -223,6 +223,8 @@
 {
   char *tmpp = malloc (strlen (line));
   char *p = malloc (strlen (line));
+  char *tmpp_orig = tmpp;
+  char *p_orig = p;
 
   /* Check if the option is present in the line */
   tmpp = strstr (line, opt);
@@ -234,7 +236,7 @@
 
   if (!_isblank (*tmpp) || *tmpp != KNOCKER_OPTION_TOKEN)
     {
-      free (tmpp);
+      free (tmpp_orig);
       return 0;
     }
 
@@ -247,8 +249,7 @@
 
   strcpy (value, p);
 
-  /* free(p); this cause knocker to segfault */
-  /* well I have to know why... */
+  free(p_orig);
 
   return 1;
 }