Better memory management - current_action->strings[] now
[privoxy.git] / actions.c
index 3fe17cb..9069e41 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -1,4 +1,4 @@
-const char actions_rcs[] = "$Id: actions.c,v 1.2 2001/05/31 21:40:00 jongfoster Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.3 2001/06/01 18:49:17 jongfoster Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/actions.c,v $
@@ -33,6 +33,10 @@ const char actions_rcs[] = "$Id: actions.c,v 1.2 2001/05/31 21:40:00 jongfoster
  *
  * Revisions   :
  *    $Log: actions.c,v $
+ *    Revision 1.3  2001/06/01 18:49:17  jongfoster
+ *    Replaced "list_share" with "list" - the tiny memory gain was not
+ *    worth the extra complexity.
+ *
  *    Revision 1.2  2001/05/31 21:40:00  jongfoster
  *    Removing some commented out, obsolete blocks of code.
  *
@@ -737,7 +741,8 @@ void merge_current_action (struct current_action_spec *dest,
       char * str = src->string[i];
       if (str)
       {
-         dest->string[i] = str;
+         freez(dest->string[i]);
+         dest->string[i] = strdup(str);
       }
    }
 
@@ -774,6 +779,11 @@ void free_current_action (struct current_action_spec *src)
 {
    int i;
 
+   for (i = 0; i < ACTION_STRING_COUNT; i++)
+   {
+      freez(src->string[i]);
+   }
+
    for (i = 0; i < ACTION_MULTI_COUNT; i++)
    {
       destroy_list(src->multi[i]);