mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmaker: main.c fix realloc mistake
As reported by cppcheck: [src/main.c:141]: (error) Common realloc mistake: 'wVisualID' nulled but not freed upon failure The patch is using wrealloc instead of the standard realloc().
This commit is contained in:
committed by
Carlos R. Mafra
parent
8d731b719e
commit
abc2d13f7d
@@ -138,7 +138,7 @@ static void setWVisualID(int screen, int val)
|
|||||||
int oldlen = wVisualID_len;
|
int oldlen = wVisualID_len;
|
||||||
|
|
||||||
wVisualID_len = screen + 1;
|
wVisualID_len = screen + 1;
|
||||||
wVisualID = (int *)realloc(wVisualID, wVisualID_len * sizeof(int));
|
wVisualID = (int *)wrealloc(wVisualID, wVisualID_len * sizeof(int));
|
||||||
for (i = oldlen; i < wVisualID_len; i++) {
|
for (i = oldlen; i < wVisualID_len; i++) {
|
||||||
wVisualID[i] = -1;
|
wVisualID[i] = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user