Changeset 8b81fec859b8975d71336c3fe1886b4878a7c192

Show
Ignore:
Timestamp:
02/13/06 11:47:43 (3 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1139827663 +0000
git-parent:

[99ca63cb29503eea8276e82eba910f8595dab208]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1139827663 +0000
Message:

- memleak fix
- getcwd() unicode fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_filter/timeshift.c

    r543574f r8b81fec  
    536536    char *psz_filename_base; 
    537537 
    538     if( psz_dir && !*psz_dir
     538    if( ( psz_dir != NULL ) && ( psz_dir[0] == '\0' )
    539539    { 
    540540        free( psz_dir ); 
    541         psz_dir = 0
    542     } 
    543  
    544     if( !psz_dir
     541        psz_dir = NULL
     542    } 
     543 
     544    if( psz_dir == NULL
    545545    { 
    546546#ifdef WIN32 
     547        char psz_local_dir[MAX_PATH]; 
    547548        int i_size; 
    548549 
    549         psz_dir = malloc( MAX_PATH + 1 ); 
    550         i_size = GetTempPath( MAX_PATH, psz_dir ); 
     550        i_size = GetTempPath( MAX_PATH, psz_local_dir ); 
    551551        if( i_size <= 0 || i_size > MAX_PATH ) 
    552552        { 
    553             if( !getcwd( psz_dir, MAX_PATH ) ) strcpy( psz_dir, "c:" ); 
    554         } 
     553            if( !getcwd( psz_local_dir, MAX_PATH ) ) 
     554                strcpy( psz_local_dir, "C:" ); 
     555        } 
     556 
     557        psz_dir = FromLocaleDup( MAX_PATH + 1 ); 
    555558 
    556559        /* remove last \\ if any */ 
     
    558561            psz_dir[strlen(psz_dir)-1] = '\0'; 
    559562#else 
    560  
    561563        psz_dir = strdup( "/tmp" ); 
    562564#endif 
     
    565567    asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%d-", 
    566568              psz_dir, getpid(), p_access->i_object_id ); 
     569    free( psz_dir ); 
    567570 
    568571    return psz_filename_base;