Changeset 3875


Ignore:
Timestamp:
11/02/09 18:53:07 (4 years ago)
Author:
pterjan
Message:
  • Fix valgrind reported errors from previous commit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/grab.c

    r3874 r3875  
    225225        { 
    226226            char path[4096]; 
    227             readlink(pglob2.gl_pathv[j], path, sizeof(path)); 
     227            ssize_t l = readlink(pglob2.gl_pathv[j], path, sizeof(path)); 
     228            if(l <= 0) 
     229                continue; 
     230            path[l] = '\0'; 
    228231            if(strstr(path, "/dev/pt")) 
    229232            { 
     
    366369        screen_list->cv = NULL; 
    367370    } 
     371    if(nb_process > 0) 
     372    { 
     373        for(i=0; i<nb_process; i++) 
     374        { 
     375            free(process_list[i].cmdline); 
     376        } 
     377        free(process_list); 
     378    } 
    368379    return ret; 
    369380} 
Note: See TracChangeset for help on using the changeset viewer.