From: Jon Trulson Date: Sat, 31 Mar 2018 23:21:34 +0000 (-0600) Subject: dtfile/SharedProcs.c: coverity CID 89068; use after free X-Git-Tag: 2.2.4a~165 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c32b5db653462d4a0128b64d5861182095dbce55;p=oweals%2Fcde.git dtfile/SharedProcs.c: coverity CID 89068; use after free --- diff --git a/cde/programs/dtfile/SharedProcs.c b/cde/programs/dtfile/SharedProcs.c index 7ec46455..b57c3f7e 100644 --- a/cde/programs/dtfile/SharedProcs.c +++ b/cde/programs/dtfile/SharedProcs.c @@ -787,9 +787,10 @@ _DtCheckAndFreePixmapData( XtFree( tmp ); } - + DtDtsFreeAttributeValue(pixmapData->instanceIconName); + pixmapData->instanceIconName = NULL; if (iconGadget->icon.pixmap == 0 || iconGadget->icon.pixmap_width == 0 || @@ -824,15 +825,17 @@ _DtCheckAndFreePixmapData( - XtSetArg(args[0], XmNimageName, pixmapData->iconFileName); - XtSetValues((Widget) iconGadget, args, 1); + XtSetArg(args[0], XmNimageName, pixmapData->iconFileName); + XtSetValues((Widget) iconGadget, args, 1); - DtDtsFreeAttributeValue(pixmapData->iconName); + DtDtsFreeAttributeValue(pixmapData->iconName); + pixmapData->iconName = NULL; } } else { DtDtsFreeAttributeValue(pixmapData->iconName); + pixmapData->iconName = NULL; } DtDtsFreeAttributeValue(pixmapData->hostPrefix);