summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-01 03:47:58 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-01 03:47:58 +0000
commit308b4ea0476659c324e0b1f979f2f83aaf9a4547 (patch)
treefe7a7222aebaaa98bde1670b2be791a344c69b24 /recordmydesktop
parent6c2cf7fe0e7c55d832236bf54489231a1f65fbb9 (diff)
more leaks fixed
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@77 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/rectinsert.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c
index a4bb7a6..aefeb1e 100644
--- a/recordmydesktop/src/rectinsert.c
+++ b/recordmydesktop/src/rectinsert.c
@@ -318,11 +318,12 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
total_insertions--;
if(temp->prev!=NULL){//no root
if(temp->next!=NULL){//
+ RectArea *temp1=temp->next;
temp->prev->next=temp->next;
temp->next->prev=temp->prev;
- temp=temp->next;
+ free(temp);
if((wgeom->width>0)&&(wgeom->height>0))
- total_insertions+=RectInsert(&temp,wgeom);
+ total_insertions+=RectInsert(&temp1,wgeom);
}
else{
temp->prev->next=newnode;
@@ -350,6 +351,7 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
}
break;
case 2://done,area is already covered
+ free(newnode);
break;
case -1://current node is broken and reinserted(in same pos)
//newnode is also reinserted
@@ -388,6 +390,7 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
temp->prev->next=temp->next;
total_insertions+=RectInsert(&temp->next,wgeom);
}
+ free(temp);
}
break;
case -2://new is broken and reinserted
@@ -425,6 +428,7 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
newnode->geom.width=wgeom_return[0]->width;
newnode->geom.height=wgeom_return[0]->height;
*root=newnode;
+ free(temp);
}
else{
total_insertions--;
@@ -446,11 +450,12 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
}
else{//remove node and reinsert, starting where we were
total_insertions--;
+ RectArea *temp1=temp->next;
temp->prev->next=temp->next;
temp->next->prev=temp->prev;
- temp=temp->next;
+ free(temp);
if((wgeom_return[0]->width>0)&&(wgeom_return[0]->height>0))
- total_insertions+=RectInsert(&temp,wgeom_return[0]);
+ total_insertions+=RectInsert(&temp1,wgeom_return[0]);
}
break;
}
© All Rights Reserved