1
0
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:
dan
2002-03-01 10:03:35 +00:00
parent 1cd1f16c3c
commit efb0090f8c
3 changed files with 14 additions and 6 deletions

View File

@@ -245,12 +245,14 @@ SetupEnvironment(WScreen *scr)
*ptr = 0; *ptr = 0;
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)

View File

@@ -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,10 +1253,13 @@ 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) {
freeDict = True; if (WMIsPLDictionary(shared_dict)) {
dict = WMDeepCopyPropList(domain->dictionary); freeDict = True;
WMSubtractPLDictionaries(dict, shared_dict, True); dict = WMDeepCopyPropList(domain->dictionary);
WMSubtractPLDictionaries(dict, shared_dict, True);
}
WMReleasePropList(shared_dict);
} }
} }
} }

View File

@@ -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;
} }