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/pkg_dest.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/pkg_dest.c')
-rw-r--r-- | libopkg/pkg_dest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libopkg/pkg_dest.c b/libopkg/pkg_dest.c index b5cfe23..b1b502a 100644 --- a/libopkg/pkg_dest.c +++ b/libopkg/pkg_dest.c @@ -24,14 +24,15 @@ #include "opkg_conf.h" #include "opkg_cmd.h" #include "opkg_defines.h" +#include "libbb/libbb.h" int pkg_dest_init(pkg_dest_t *dest, const char *name, const char *root_dir,const char * lists_dir) { - dest->name = strdup(name); + dest->name = xstrdup(name); /* Guarantee that dest->root_dir ends with a '/' */ if (str_ends_with(root_dir, "/")) { - dest->root_dir = strdup(root_dir); + dest->root_dir = xstrdup(root_dir); } else { sprintf_alloc(&dest->root_dir, "%s/", root_dir); } |