mirror of
https://github.com/morgant/mlvwm.git
synced 2026-04-26 12:19:06 +00:00
Fixed bugs in config.c & mlvwm.c where calloc() was being used to accidentally allocate memory for a number of MlvwmWindows instead of just a number of pointers to MlvwmWindows for Scr.LastActive, as identified by clang scan-build. Issue #48
This commit is contained in:
+1
-1
@@ -409,7 +409,7 @@ void SetDeskTopNum( char *line, FILE *fp )
|
||||
AddMenuItem( &(Scr.IconMenu), label, action, NULL, NULL, NULL, STRGRAY );
|
||||
if( Scr.LastActive!=NULL )
|
||||
free( Scr.LastActive );
|
||||
Scr.LastActive = calloc( Scr.n_desktop, sizeof(MlvwmWindow));
|
||||
Scr.LastActive = calloc( Scr.n_desktop, sizeof(MlvwmWindow*));
|
||||
}
|
||||
|
||||
void SetRstPrevState( char *line, FILE *fp )
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ void InitScrParams( void )
|
||||
Scr.MlvwmRoot.w = Scr.Root;
|
||||
Scr.MlvwmRoot.prev = NULL;
|
||||
Scr.MlvwmRoot.next = NULL;
|
||||
Scr.LastActive = calloc( 1, sizeof(MlvwmWindow));
|
||||
Scr.LastActive = calloc( 1, sizeof(MlvwmWindow*));
|
||||
Scr.MyDisplayWidth = DisplayWidth( dpy, Scr.screen );
|
||||
Scr.MyDisplayHeight = DisplayHeight( dpy, Scr.screen );
|
||||
Scr.MenuLabelRoot = NULL;
|
||||
|
||||
Reference in New Issue
Block a user