diff --git a/lib/initend.c b/lib/initend.c index e849deef..f56c7ed7 100644 --- a/lib/initend.c +++ b/lib/initend.c @@ -120,7 +120,7 @@ store_preserved_file(struct xbps_handle *xhp, const char *file) len = strlen(globbuf.gl_pathv[i]) - strlen(xhp->rootdir) + 1; p = malloc(len); - assert(len); + assert(p); strlcpy(p, globbuf.gl_pathv[i] + strlen(xhp->rootdir), len); xbps_array_add_cstring(xhp->preserved_files, p); xbps_dbg_printf(xhp, "Added preserved file: %s (expanded from %s)\n", p, file);