mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
fixed some memleaks (1 serious, 5 minor)
This commit is contained in:
@@ -246,11 +246,13 @@ SetupEnvironment(WScreen *scr)
|
|||||||
snprintf(buf, sizeof(buf), ".%i", scr->screen);
|
snprintf(buf, sizeof(buf), ".%i", scr->screen);
|
||||||
strcat(tmp, buf);
|
strcat(tmp, buf);
|
||||||
putenv(tmp);
|
putenv(tmp);
|
||||||
|
wfree(tmp);
|
||||||
}
|
}
|
||||||
tmp = wmalloc(60);
|
tmp = wmalloc(60);
|
||||||
snprintf(tmp, 60, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen,
|
snprintf(tmp, 60, "WRASTER_COLOR_RESOLUTION%i=%i", scr->screen,
|
||||||
scr->rcontext->attribs->colors_per_channel);
|
scr->rcontext->attribs->colors_per_channel);
|
||||||
putenv(tmp);
|
putenv(tmp);
|
||||||
|
wfree(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -595,6 +597,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
str = wstrconcat("WMAKER_BIN_NAME=", argv[0]);
|
str = wstrconcat("WMAKER_BIN_NAME=", argv[0]);
|
||||||
putenv(str);
|
putenv(str);
|
||||||
|
wfree(str);
|
||||||
|
|
||||||
ArgCount = argc;
|
ArgCount = argc;
|
||||||
Arguments = argv;
|
Arguments = argv;
|
||||||
@@ -782,6 +785,7 @@ main(int argc, char **argv)
|
|||||||
snprintf(str, len, "DISPLAY=%s", DisplayName);
|
snprintf(str, len, "DISPLAY=%s", DisplayName);
|
||||||
}
|
}
|
||||||
putenv(str);
|
putenv(str);
|
||||||
|
wfree(str);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (doSync)
|
if (doSync)
|
||||||
|
|||||||
@@ -1243,7 +1243,7 @@ UpdateDomainFile(WDDomain *domain)
|
|||||||
{
|
{
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
WMPropList *shared_dict=NULL, *dict;
|
WMPropList *shared_dict, *dict;
|
||||||
Bool result, freeDict = False;
|
Bool result, freeDict = False;
|
||||||
|
|
||||||
dict = domain->dictionary;
|
dict = domain->dictionary;
|
||||||
@@ -1253,11 +1253,14 @@ UpdateDomainFile(WDDomain *domain)
|
|||||||
SYSCONFDIR, domain->domain_name);
|
SYSCONFDIR, domain->domain_name);
|
||||||
if (stat(path, &stbuf) >= 0) {
|
if (stat(path, &stbuf) >= 0) {
|
||||||
shared_dict = WMReadPropListFromFile(path);
|
shared_dict = WMReadPropListFromFile(path);
|
||||||
if (shared_dict && WMIsPLDictionary(shared_dict)) {
|
if (shared_dict) {
|
||||||
|
if (WMIsPLDictionary(shared_dict)) {
|
||||||
freeDict = True;
|
freeDict = True;
|
||||||
dict = WMDeepCopyPropList(domain->dictionary);
|
dict = WMDeepCopyPropList(domain->dictionary);
|
||||||
WMSubtractPLDictionaries(dict, shared_dict, True);
|
WMSubtractPLDictionaries(dict, shared_dict, True);
|
||||||
}
|
}
|
||||||
|
WMReleasePropList(shared_dict);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1041,6 +1041,7 @@ RConvertImageMask(RContext *context, RImage *image, Pixmap *pixmap,
|
|||||||
RPutXImage(context, *mask, gc, ximg, 0, 0, 0, 0,
|
RPutXImage(context, *mask, gc, ximg, 0, 0, 0, 0,
|
||||||
image->width, image->height);
|
image->width, image->height);
|
||||||
RDestroyXImage(context, ximg);
|
RDestroyXImage(context, ximg);
|
||||||
|
XFreeGC(context->dpy, gc);
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user