[libdvbpsi-devel] [PATCH] dr_81: allocate p_decoded with calloc rather than malloc

Michael Krufky mkrufky at linuxtv.org
Wed Feb 5 05:19:13 CET 2014


Jean-Paul,

Please disregard my previous patch... This one is a better cleanup:


The following changes since commit 6ab64fb30a0daa3a042d71abb6addd110d6e441a:

  ATSC MGT: make sure all members are initialized. (2014-02-04 11:20:45 +0100)

are available in the git repository at:

  https://github.com/mkrufky/libdvbpsi.git for_upstream

for you to fetch changes up to eb1c3944f4b658065c79c8a5c422e97f5c52c473:

  dr_81: allocate p_decoded with calloc rather than malloc (2014-02-04 22:10:38 -0500)


Michael Krufky (1):
      dr_81: allocate p_decoded with calloc rather than malloc

 src/descriptors/dr_81.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



commit eb1c3944f4b658065c79c8a5c422e97f5c52c473
Author: Michael Krufky <mkrufky at linuxtv.org>
Date:   Wed Dec 25 22:41:49 2013 -0500

    dr_81: allocate p_decoded with calloc rather than malloc
    
    Signed-off-by: Michael Krufky <mkrufky at linuxtv.org>

diff --git a/src/descriptors/dr_81.c b/src/descriptors/dr_81.c
index ca41c3d..263a483 100644
--- a/src/descriptors/dr_81.c
+++ b/src/descriptors/dr_81.c
@@ -59,7 +59,7 @@ dvbpsi_ac3_audio_dr_t *dvbpsi_DecodeAc3AudioDr(dvbpsi_descriptor_t *p_descriptor
     if (p_descriptor->i_length < 3)
         return NULL;
 
-    p_decoded = (dvbpsi_ac3_audio_dr_t*)malloc(sizeof(dvbpsi_ac3_audio_dr_t));
+    p_decoded = (dvbpsi_ac3_audio_dr_t*)calloc(1, sizeof(dvbpsi_ac3_audio_dr_t));
     if (!p_decoded)
         return NULL;
 


More information about the libdvbpsi-devel mailing list