s/strdup/xstrdup/ - check memory allocations for failure.
[oweals/opkg-lede.git] / libopkg / opkg_install.c
index e7268676962e1a678bf78ca1b0ed07b2b695abf3..2d5bb4e4692b40b44c468bc664f1ca39ca677c51 100644 (file)
@@ -44,6 +44,7 @@ typedef void (*sighandler_t)(int);
 #include "str_util.h"
 #include "xsystem.h"
 #include "user.h"
+#include "libbb/libbb.h"
 
 static int verify_pkg_installable(opkg_conf_t *conf, pkg_t *pkg);
 static int unpack_pkg_control_files(opkg_conf_t *conf, pkg_t *pkg);
@@ -1135,7 +1136,7 @@ static int preinst_configure(opkg_conf_t *conf, pkg_t *pkg, pkg_t *old_pkg)
          sprintf_alloc(&preinst_args, "install %s", pkg_version);
          free(pkg_version);
      } else {
-         preinst_args = strdup("install");
+         preinst_args = xstrdup("install");
      }
 
      err = pkg_run_script(conf, pkg, "preinst", preinst_args);