diff --git a/lib/package_script.c b/lib/package_script.c index 5b50c333..0031bab5 100644 --- a/lib/package_script.c +++ b/lib/package_script.c @@ -72,18 +72,18 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp, /* Create temp file to run script */ if ((fd = mkstemp(fpath)) == -1) { + rv = errno; xbps_dbg_printf(xhp, "%s: mkstemp %s\n", __func__, strerror(errno)); - free(fpath); - return errno; + goto out; } /* write blob to our temp fd */ ret = write(fd, blob, blobsiz); if (ret == -1) { + rv = errno; xbps_dbg_printf(xhp, "%s: write %s\n", __func__, strerror(errno)); close(fd); - rv = errno; goto out; } fchmod(fd, 0750);