diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:42 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:58:29 -0700 |
commit | cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e (patch) | |
tree | ebc4c13ebd7471cbfa7425c190303793ea5b7ff9 /render/render.c | |
parent | ef0f701c9245b0373eb0c7a84dd804af4738bb29 (diff) |
Use calloc to zero fill buffers being allocated for replies & events
Ensures padding bytes are zero-filled
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'render/render.c')
-rw-r--r-- | render/render.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/render/render.c b/render/render.c index be7d21e86..3bf070268 100644 --- a/render/render.c +++ b/render/render.c @@ -531,7 +531,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof(xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength); + reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength); if (!reply) return BadAlloc; @@ -1688,7 +1688,7 @@ ProcRenderQueryFilters(ClientPtr client) } len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName); total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) malloc(total_bytes); + reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); |