From 11af232b19155c76002b5ca1f2b0e89d75699d3a Mon Sep 17 00:00:00 2001 From: graham.gower Date: Tue, 03 Nov 2009 22:14:59 -0500 Subject: s/strdup/xstrdup/ - check memory allocations for failure. git-svn-id: http://opkg.googlecode.com/svn/trunk@255 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg/hash_table.c') 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 #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; -- cgit v0.9.1