[vlc-commits] commit: Fixed a potential double free if an error occurs while saving the configuration . (Laurent Aimar )

git at videolan.org git at videolan.org
Sun Oct 31 13:05:28 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Oct 31 12:32:51 2010 +0100| [a5429b614377c877e8fb58cf8eb1b17a676bd3b7] | committer: Laurent Aimar 

Fixed a potential double free if an error occurs while saving the configuration.

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

 src/config/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/config/file.c b/src/config/file.c
index 3d71712..5d1f66b 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -700,7 +700,6 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
      * Restore old settings from the config in file
      */
     fputs( p_bigbuffer, file );
-    free( p_bigbuffer );
 
     /*
      * Flush to disk and replace atomically
@@ -738,6 +737,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
 
     free (temporary);
     free (permanent);
+    free( p_bigbuffer );
     return 0;
 
 error:



More information about the vlc-commits mailing list