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/pkg_depends.c') diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c index e5c50c9..6ce9fdd 100644 --- a/libopkg/pkg_depends.c +++ b/libopkg/pkg_depends.c @@ -25,6 +25,7 @@ #include "opkg_message.h" #include "pkg_parse.h" #include "hash_table.h" +#include "libbb/libbb.h" static int parseDepends(compound_depend_t *compound_depend, hash_table_t * hash, char * depend_str); static depend_t * depend_init(void); @@ -609,7 +610,7 @@ char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx) fprintf(stderr, "%s: out of memory\n", __FUNCTION__); return NULL; } - resized[count - 1] = strdup(depend_str); + resized[count - 1] = xstrdup(depend_str); resized[count] = NULL; return resized; -- cgit v0.9.1