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