[vlc-commits] ML: no need for asprintf here, strdup is enough.

Rémi Duraffort git at videolan.org
Mon Mar 21 20:38:25 CET 2011


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Mar 21 20:35:46 2011 +0100| [a7549358284bb73fdf18f54888952bd1f6c5815f] | committer: Rémi Duraffort

ML: no need for asprintf here, strdup is enough.

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

 modules/media_library/sql_search.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/media_library/sql_search.c b/modules/media_library/sql_search.c
index b78e993..fdd632a 100644
--- a/modules/media_library/sql_search.c
+++ b/modules/media_library/sql_search.c
@@ -956,7 +956,8 @@ static int BuildWhere( media_library_t* p_ml, char **ppsz_where, ml_ftree_t* tre
             if( i_ret != VLC_SUCCESS )
                 goto parsefail;
             /* Ignore right parse tree as this is a special node */
-            if( asprintf( ppsz_where, "%s", psz_left ? psz_left : "" ) == -1 )
+            *ppsz_where = strdup( psz_left ? psz_left : "" );
+            if( !*ppsz_where )
             {
                 i_ret = VLC_ENOMEM;
                 goto parsefail;



More information about the vlc-commits mailing list