xbps-repo: zero out allocated mem to avoid garbage in the 'search' target.

This commit is contained in:
Juan RP 2010-12-04 10:31:17 +01:00
parent 4f6e20c431
commit 60c37406c1

View File

@ -226,7 +226,7 @@ show_pkg_namedesc(prop_object_t obj, void *arg, bool *loop_done)
(xbps_pkgpattern_match(desc, rsd->pattern) == 1) || (xbps_pkgpattern_match(desc, rsd->pattern) == 1) ||
(strcmp(pkgname, rsd->pattern) == 0) || (strcmp(pkgname, rsd->pattern) == 0) ||
(strstr(pkgver, rsd->pattern)) || (strstr(desc, rsd->pattern))) { (strstr(pkgver, rsd->pattern)) || (strstr(desc, rsd->pattern))) {
tmp = malloc(rsd->pkgver_len + 1); tmp = calloc(1, rsd->pkgver_len + 1);
if (tmp == NULL) if (tmp == NULL)
return errno; return errno;