- WTF?! Do not use non-existant vlc_closedir_wrapper
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 11 Dec 2006 16:56:21 +0000 (16:56 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 11 Dec 2006 16:56:21 +0000 (16:56 +0000)
- Do not leak result from utf8_readdir (ALWAYS strdup'ed).

modules/demux/mkv.cpp
modules/gui/ncurses.c
modules/misc/gnutls.c
src/text/unicode.c
src/video_output/vout_intf.c

index 6a2823c..5600c07 100644 (file)
@@ -1547,9 +1547,9 @@ static int Open( vlc_object_t * p_this )
                             }
                         }
                     }
-                    LocaleFree (psz_file);
+                    free (psz_file);
                 }
-                vlc_closedir_wrapper( p_src_dir );
+                closedir( p_src_dir );
             }
         }
 
index 15a77b9..857db4f 100644 (file)
@@ -1995,7 +1995,7 @@ static void ReadDir( intf_thread_t *p_intf )
         qsort( p_sys->pp_dir_entries, p_sys->i_dir_entries,
                sizeof(struct dir_entry_t*), &comp_dir_entries );
 
-        vlc_closedir_wrapper( p_current_dir );
+        closedir( p_current_dir );
         return;
     }
     else
index 2ee21b3..58a052a 100644 (file)
@@ -597,7 +597,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
          || fstat( fd, &st1 ) || utf8_lstat( psz_dirname, &st2 )
          || S_ISLNK( st2.st_mode ) || ( st1.st_ino != st2.st_ino ) )
         {
-            vlc_closedir_wrapper( dir );
+            closedir( dir );
             return VLC_EGENERIC;
         }
     }
@@ -619,7 +619,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
         gnutls_Addx509File( p_this, cred, path, b_priv );
     }
 
-    vlc_closedir_wrapper( dir );
+    closedir( dir );
     return VLC_SUCCESS;
 }
 
index 5fa2843..5b4adf4 100644 (file)
@@ -436,7 +436,8 @@ int utf8_mkdir( const char *dirname )
  *
  * @param dirname UTF-8 representation of the directory name
  *
- * @return a pointer to the DIR struct. Use vlc_closedir_wrapper() once you are done.
+ * @return a pointer to the DIR struct. Release with closedir().
+ */
 DIR *utf8_opendir( const char *dirname )
 {
 #ifdef WIN32
@@ -531,7 +532,7 @@ int utf8_scandir( const char *dirname, char ***namelist,
             tab = newtab;
             tab[num++] = entry;
         }
-        vlc_closedir_wrapper( dir );
+        closedir( dir );
 
         if( compar != NULL )
             qsort( tab, num, sizeof( tab[0] ),
index 3812218..f2c7c24 100644 (file)
@@ -637,7 +637,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
         char *psz_prefix = var_GetString( p_vout, "snapshot-prefix" );
         if( !psz_prefix ) psz_prefix = strdup( "vlcsnap-" );
 
-        vlc_closedir_wrapper( path );
+        closedir( path );
         if( var_GetBool( p_vout, "snapshot-sequential" ) == VLC_TRUE )
         {
             int i_num = var_GetInteger( p_vout, "snapshot-num" );