From 441a396f610b89f9415f14ed407678ea4cfbde2b Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 12 Jan 2007 15:07:10 +0000 Subject: [PATCH] Use zalloc in cgi_send_user_manual. --- cgisimple.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cgisimple.c b/cgisimple.c index 9504ef9e..4b0e78e3 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.45 2006/12/28 18:16:41 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.46 2007/01/02 12:49:46 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,10 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.45 2006/12/28 18:16:41 fabian * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.46 2007/01/02 12:49:46 fabiankeil + * Add FEATURE_ZLIB to the list of conditional + * defines at the show-status page. + * * Revision 1.45 2006/12/28 18:16:41 fabiankeil * Fixed gcc43 compiler warnings, zero out cgi_send_user_manual's * body memory before using it, replaced sprintf calls with snprintf. @@ -788,14 +792,13 @@ jb_err cgi_send_user_manual(struct client_state *csp, fseek(fp, 0, SEEK_SET); /* Allocate memory and load the file directly into the body */ - rsp->body = (char *)malloc(length+1); + rsp->body = (char *)zalloc(length+1); if (!rsp->body) { fclose(fp); free(full_path); return JB_ERR_MEMORY; } - memset(rsp->body, '\0', length+1); if (!fread(rsp->body, length, 1, fp)) { /* -- 2.39.2