s/strdup/xstrdup/ - check memory allocations for failure.
[oweals/opkg-lede.git] / libopkg / pkg_depends.c
index e5c50c94d2786a2fa29392a382337f8968d796c2..6ce9fdd3c8e2aeca37605ee62e46f9110a4e0d80 100644 (file)
@@ -25,6 +25,7 @@
 #include "opkg_message.h"
 #include "pkg_parse.h"
 #include "hash_table.h"
 #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);
 
 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;
     }
        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;
     resized[count] = NULL;
     
     return resized;