commit cebc5223abdec2d1d1862960ff0c473850eba134 from: the xhr date: Wed Aug 25 12:04:07 2021 UTC Replace malloc() in xmalloc() with calloc() so that all memory get zero'ed out at allocation time. Remove a then useless memset commit - 603332391cfd7951818975b787b57c38a3ce46d0 commit + cebc5223abdec2d1d1862960ff0c473850eba134 blob - 609f3685eeeb7ac318a2ac6c07916e911fab47de blob + 1cc20ca7cd7782a967bc6e1b20b4c9b4c37e6b31 --- request.c +++ request.c @@ -39,8 +39,6 @@ uridecode(const char *request) const char *p; char *pt; - memset(temp, 0, strlen(request)+1); - p = request; pt = temp; blob - 1f836d99eb7213ca9e0ddfbcca07ca1d31db3817 blob + f6494dbe253ef36d68479b90221a3068c195864b --- util.c +++ util.c @@ -27,7 +27,7 @@ xmalloc(size_t size) if (size == 0) fatal("xmalloc: zero size"); - ptr = malloc(size); + ptr = calloc(1, size); if (ptr == NULL) fatal("xmalloc: out of memory (allocating %zu bytes)", size); return ptr;