Fix 1 off memory leak

This commit is contained in:
Dave Davenport 2015-12-23 17:03:00 +01:00
parent 270ec0c14b
commit 696d0a2fa0
1 changed files with 5 additions and 1 deletions

View File

@ -93,8 +93,12 @@ static char **get_dmenu ( FILE *fd, unsigned int *length )
break;
}
}
if ( data != NULL ) {
free ( data );
data = NULL;
}
if ( retv != NULL ) {
retv = g_realloc ( retv, ( *length + 1 ) * sizeof ( char* ) );
retv = g_realloc ( retv, ( *length + 1 ) * sizeof ( char* ) );
retv[( *length ) ] = NULL;
}
TICK_N ( "Read stdin STOP" );