From f73ccae798bd73404d983e925213286db7de8171 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 11 May 2013 00:07:10 +0200 Subject: [PATCH] Removed temporary allocation to build a path that is actually a constant This allocation was certainly participating to memory fragmentation. --- WPrefs.app/Menu.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c index 7780df14..85639b05 100644 --- a/WPrefs.app/Menu.c +++ b/WPrefs.app/Menu.c @@ -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; }