dtfile/SharedProcs.c: coverity CID 89068; use after free
authorJon Trulson <jon@radscan.com>
Sat, 31 Mar 2018 23:21:34 +0000 (17:21 -0600)
committerJon Trulson <jon@radscan.com>
Sat, 31 Mar 2018 23:21:34 +0000 (17:21 -0600)
cde/programs/dtfile/SharedProcs.c

index 7ec464555e6549231b9ac2067cde7b2a95a90080..b57c3f7e639fbbf1cb64a6d0506eea7b8133e5cc 100644 (file)
@@ -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);