mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-10 07:44:14 +01:00
Removed temporary allocation to build a path that is actually a constant
This allocation was certainly participating to memory fragmentation.
This commit is contained in:
committed by
Carlos R. Mafra
parent
7c320447fb
commit
f73ccae798
@@ -1450,15 +1450,9 @@ static void buildMenuFromPL(_Panel * panel, WMPropList * pl)
|
||||
static WMPropList *getDefaultMenu(_Panel * panel)
|
||||
{
|
||||
WMPropList *menu;
|
||||
char *menuPath, *gspath;
|
||||
|
||||
gspath = wstrdup(WMAKER_RESOURCE_PATH);
|
||||
|
||||
menuPath = wmalloc(strlen(gspath) + 128);
|
||||
sprintf(menuPath, "%s/plmenu", gspath);
|
||||
static const char menuPath[] = WMAKER_RESOURCE_PATH "/plmenu";
|
||||
|
||||
menu = WMReadPropListFromFile(menuPath);
|
||||
|
||||
if (!menu) {
|
||||
char *buffer, *msg;
|
||||
|
||||
@@ -1470,9 +1464,6 @@ static WMPropList *getDefaultMenu(_Panel * panel)
|
||||
wfree(buffer);
|
||||
}
|
||||
|
||||
wfree(gspath);
|
||||
wfree(menuPath);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user