[Asterisk-cvs] zaptel wct4xxp.c,1.58,1.59

markster at lists.digium.com markster at lists.digium.com
Tue Apr 12 23:00:34 CDT 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv6631

Modified Files:
	wct4xxp.c 
Log Message:
Fix memory leak on loading/unloading module


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- wct4xxp.c	1 Apr 2005 18:19:29 -0000	1.58
+++ wct4xxp.c	13 Apr 2005 03:52:17 -0000	1.59
@@ -1670,6 +1670,7 @@
 static void __devexit t4_remove_one(struct pci_dev *pdev)
 {
 	struct t4 *wc = pci_get_drvdata(pdev);
+	int x;
 	if (wc) {
 		/* Stop hardware */
 		t4_hardware_stop(wc);
@@ -1709,6 +1710,11 @@
 #endif		
 		cards[wc->num] = NULL;
 		pci_set_drvdata(pdev, NULL);
+		for (x=0;x<4;x++) {
+			if (wc->chans[x])
+				kfree(wc->chans[x]);
+		}
+		kfree(wc);
 	}
 }
 




More information about the svn-commits mailing list