]> Dogcows Code - chaz/openbox/commitdiff
some memory bugs from woodblock (thanks!)
authorDana Jansens <danakj@orodu.net>
Wed, 3 Jul 2002 05:26:11 +0000 (05:26 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 3 Jul 2002 05:26:11 +0000 (05:26 +0000)
src/Screen.cc
src/Window.cc

index 775254c66d3147c67a23e9ab9b36d5539d52d499..dac5d6f8938421579ec4b3b2bb86761f66257a3d 100644 (file)
@@ -1303,6 +1303,7 @@ void BScreen::updateWorkArea(void) {
     }
     xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
                     dims, 4 * workspacesList.size());
+    delete [] dims;
   } else
     xatom->setValue(getRootWindow(), XAtom::net_workarea, XAtom::cardinal,
                     0, 0);
index e735d07b8809352977cc877c4edd126a0016ed10..3816538da4fc4f9fa56d6ca781ef270d743dee9f 100644 (file)
@@ -1225,9 +1225,12 @@ void BlackboxWindow::getMWMHints(void) {
   num = PropMwmHintsElements;
   if (! xatom->getValue(client.window, XAtom::motif_wm_hints,
                         XAtom::motif_wm_hints, num,
-                        (unsigned long **)&mwm_hint) ||
-      num < PropMwmHintsElements)
+                        (unsigned long **)&mwm_hint))
     return;
+  if (num < PropMwmHintsElements) {
+    delete [] mwm_hint;
+    return;
+  }
 
   if (mwm_hint->flags & MwmHintsDecorations) {
     if (mwm_hint->decorations & MwmDecorAll) {
@@ -1268,7 +1271,7 @@ void BlackboxWindow::getMWMHints(void) {
         functions |= Func_Close;
     }
   }
-  delete mwm_hint;
+  delete [] mwm_hint;
 }
 
 
@@ -1286,9 +1289,12 @@ bool BlackboxWindow::getBlackboxHints(void) {
   num = PropBlackboxHintsElements;
   if (! xatom->getValue(client.window, XAtom::blackbox_hints,
                         XAtom::blackbox_hints, num,
-                        (unsigned long **)&blackbox_hint) ||
-      num < PropBlackboxHintsElements)
+                        (unsigned long **)&blackbox_hint))
     return False;
+  if (num < PropBlackboxHintsElements) {
+    delete [] blackbox_hint;
+    return False;
+  }
 
   if (blackbox_hint->flags & AttribShaded)
     flags.shaded = (blackbox_hint->attrib & AttribShaded);
@@ -1350,7 +1356,7 @@ bool BlackboxWindow::getBlackboxHints(void) {
     reconfigure();
   }
   
-  delete blackbox_hint;
+  delete [] blackbox_hint;
 
   return True;
 }
@@ -2103,7 +2109,7 @@ void BlackboxWindow::restoreAttributes(void) {
                         (unsigned long **)&net))
     return;
   if (num < PropBlackboxAttributesElements) {
-    delete net;
+    delete [] net;
     return;
   }
 
@@ -2169,7 +2175,7 @@ void BlackboxWindow::restoreAttributes(void) {
   // with the state set it will then be the map event's job to read the
   // window's state and behave accordingly
 
-  delete net;
+  delete [] net;
 }
 
 
This page took 0.033116 seconds and 4 git commands to generate.