From: Diego 'F. P. <fla...@gm...> - 2008-04-18 23:57:32
|
# HG changeset patch # User Diego 'Flameeyes' Pettenò <fla...@gm...> # Date 1198014328 -3600 # Node ID 18e72360074d655db28b7325e4f81dc9a872905b # Parent d54e00ae6330d9e0d96ad96e8ea6106c5ac18d2e Use calloc() when allocating an array of elements. (transplanted from 332f543689ebef22ef38e052c437d6998ac8fe66) diff -r 18e72360074d655db28b7325e4f81dc9a872905b -r d54e00ae6330d9e0d96ad96e8ea6106c5ac18d2e src/xine-utils/array.c --- a/src/xine-utils/array.c Tue Dec 18 22:45:28 2007 +0100 +++ b/src/xine-utils/array.c Tue Dec 18 21:56:02 2007 +0100 @@ -56,7 +56,7 @@ xine_array_t *xine_array_new(size_t init if (initial_size < MIN_CHUNK_SIZE) initial_size = MIN_CHUNK_SIZE; - new_array->chunk = (void**)malloc(sizeof(void*) * initial_size); + new_array->chunk = (void**)calloc(initial_size, sizeof(void*)); if (!new_array->chunk) { free(new_array); return NULL; |