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

git version control git at videolan.org
Wed Aug 20 00:04:33 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Aug 20 00:07:21 2008 +0200| [182b5b894ef1fd18719899ae5b3fa811a2ddf8fe] | committer: Rémi Duraffort 

Check asprintf return value.

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

 modules/access_filter/timeshift.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/access_filter/timeshift.c b/modules/access_filter/timeshift.c
index ef977bc..924744a 100644
--- a/modules/access_filter/timeshift.c
+++ b/modules/access_filter/timeshift.c
@@ -596,8 +596,9 @@ static char *GetTmpFilePath( access_t *p_access )
 #endif
     }
 
-    asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%d-",
-              psz_dir, getpid(), p_access->i_object_id );
+    if( asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%d-",
+              psz_dir, getpid(), p_access->i_object_id ) == -1 )
+        psz_filename_base = NULL;
     free( psz_dir );
 
     return psz_filename_base;




More information about the vlc-devel mailing list