From 59bcbddcdb18e773acca0b006348327c9185b547 Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Thu, 24 Jun 2021 19:30:39 +0200 Subject: [PATCH] lib/package_script.c: xbps_pkg_exec_script: remove useless copy and free --- lib/package_script.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/package_script.c b/lib/package_script.c index 73837b0f..3082aadf 100644 --- a/lib/package_script.c +++ b/lib/package_script.c @@ -145,7 +145,7 @@ xbps_pkg_exec_script(struct xbps_handle *xhp, bool update) { xbps_data_t data; - void *buf; + const void *buf; size_t buflen; const char *pkgver = NULL; int rv; @@ -161,10 +161,9 @@ xbps_pkg_exec_script(struct xbps_handle *xhp, xbps_dictionary_get_cstring_nocopy(d, "pkgver", &pkgver); - buf = xbps_data_data(data); + buf = xbps_data_data_nocopy(data); buflen = xbps_data_size(data); rv = xbps_pkg_exec_buffer(xhp, buf, buflen, pkgver, action, update); - free(buf); return rv; }