Changeset 7d7326c


Ignore:
Timestamp:
Oct 23, 2010, 2:53:16 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
a04218c
Parents:
4c0ac34
git-author:
David Benjamin <davidben@mit.edu> (10/23/10 04:44:56)
git-committer:
David Benjamin <davidben@mit.edu> (10/23/10 14:53:16)
Message:
When deleting a variable, clean-up strings

Variables allocated from perl strdup their strings. Make this consistent
and free them afterwards.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    rc6adf17 r7d7326c  
    481481    cur = owl_malloc(sizeof(owl_variable));
    482482    *cur = *var;
     483    /* strdup all the strings so we can delete them consistently. */
     484    cur->name = owl_strdup(var->name);
     485    cur->summary = owl_strdup(var->summary);
     486    cur->description = owl_strdup(var->description);
    483487    switch (cur->type) {
    484488    case OWL_VARIABLE_OTHER:
     
    642646{
    643647  if (v->delete_fn) v->delete_fn(v);
     648  owl_free(v->name);
     649  owl_free(v->summary);
     650  owl_free(v->description);
    644651  owl_free(v);
    645652}
Note: See TracChangeset for help on using the changeset viewer.