diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-07 20:27:54 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-07 20:27:54 +0200 |
commit | ed72565137c93ab0385a10036d234f5f4dd1b960 (patch) | |
tree | 68089f28d7fd5e79e39ee81b5a2d0bd4876908f9 /src/audio_out/audio_oss_out.c | |
parent | 1230c21aea047e429f050c5ceeff20820e0d6044 (diff) | |
download | xine-lib-ed72565137c93ab0385a10036d234f5f4dd1b960.tar.gz xine-lib-ed72565137c93ab0385a10036d234f5f4dd1b960.tar.bz2 |
Avoid memset() on newly allocated memory areas.
If needed, use calloc() to allocate the area so that it's already
reset by the time it returns.
Diffstat (limited to 'src/audio_out/audio_oss_out.c')
-rw-r--r-- | src/audio_out/audio_oss_out.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 22dc4284c..df29a43ea 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -883,9 +883,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da "audio_oss_out: ...probing output buffer size: ")); this->buffer_size = 0; - if( (buf=malloc(1024)) != NULL ) { - memset(buf,0,1024); - + if( (buf=calloc(1, 1024)) != NULL ) { do { c = write(audio_fd,buf,1024); if( c != -1 ) |