diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-03 22:14:59 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-03 22:14:59 (EST) |
commit | 11af232b19155c76002b5ca1f2b0e89d75699d3a (patch) | |
tree | 5e113943ec678935d2ae1ac60b7e70bd49165f6e /libopkg/hash_table.c | |
parent | edf1b1964b565726a0b0f730b109e4491c7929b9 (diff) |
s/strdup/xstrdup/ - check memory allocations for failure.
git-svn-id: http://opkg.googlecode.com/svn/trunk@255 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/hash_table.c')
-rw-r--r-- | libopkg/hash_table.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libopkg/hash_table.c b/libopkg/hash_table.c index 713ecff..6de9085 100644 --- a/libopkg/hash_table.c +++ b/libopkg/hash_table.c @@ -21,6 +21,7 @@ #include <string.h> #include "hash_table.h" #include "opkg_message.h" +#include "libbb/libbb.h" static int hash_index(hash_table_t *hash, const char *pkg_name); @@ -155,7 +156,7 @@ int hash_table_insert(hash_table_t *hash, const char *key, void *value) } } hash->n_elements++; - hash_entry->key = strdup(key); + hash_entry->key = xstrdup(key); hash_entry->data = value; return 0; |