Changeset f25df21 for dict.c


Ignore:
Timestamp:
Mar 24, 2011, 4:05:29 PM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
c809f5e
Parents:
e56303f
git-author:
David Benjamin <davidben@mit.edu> (03/08/11 15:04:52)
git-committer:
David Benjamin <davidben@mit.edu> (03/24/11 16:05:29)
Message:
Don't call owl_list_create in owl_dict_get_keys

Until we get rid of this owl_list thing altogether, there should be a
convention as to who initializes the thing. Otherwise, we leak memory
from people initializing it too many times.

Whoever reviews this probably wants to look over this very carefully in
case I missed one of the owl_list_creates.

Also kill the various wrappers over owl_list_cleanup as they are not the
inverse of any operation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dict.c

    rd4927a7 rf25df21  
    5858}
    5959
    60 /* creates a list and fills it in with keys.  duplicates the keys,
     60/* Appends dictionary keys to a list.  Duplicates the keys,
    6161 * so they will need to be freed by the caller. */
    6262int owl_dict_get_keys(const owl_dict *d, owl_list *l) {
    6363  int i;
    6464  char *dupk;
    65   if (owl_list_create(l)) return(-1);
    6665  for (i=0; i<d->size; i++) {
    6766    if ((dupk = g_strdup(d->els[i].k)) == NULL) return(-1);
Note: See TracChangeset for help on using the changeset viewer.