[vlc-devel] commit: Check asprintf return value. ( Rémi Duraffort )

git version control git at videolan.org
Thu Jul 31 17:58:14 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 31 18:01:03 2008 +0200| [97b002337f641c9fef39903a062d738b1e4ae0b7]

Check asprintf return value.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=97b002337f641c9fef39903a062d738b1e4ae0b7
---

 src/audio_output/aout_internal.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 0af54ed..b0b8449 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -186,7 +186,10 @@ static inline bool AoutChangeFilterString( vlc_object_t *p_obj, aout_instance_t
     {
         char *psz_old = val.psz_string;
         if( *psz_old )
-            asprintf( &val.psz_string, "%s:%s", psz_old, psz_name );
+        {
+            if( asprintf( &val.psz_string, "%s:%s", psz_old, psz_name ) == -1 )
+                val.psz_string = NULL;
+        }
         else
             val.psz_string = strdup( psz_name );
         free( psz_old );




More information about the vlc-devel mailing list