[xiph-commits] r9575 - trunk/ao/src/plugins/oss

giles at svn.xiph.org giles at svn.xiph.org
Sat Jul 16 14:28:15 PDT 2005


Author: giles
Date: 2005-07-16 14:28:13 -0700 (Sat, 16 Jul 2005)
New Revision: 9575

Modified:
   trunk/ao/src/plugins/oss/ao_oss.c
Log:
Fix a memory leak in the OSS driver. The path name and an error
string were leaking whenever open succeeded on the non-devfs
device path.


Modified: trunk/ao/src/plugins/oss/ao_oss.c
===================================================================
--- trunk/ao/src/plugins/oss/ao_oss.c	2005-07-16 19:36:56 UTC (rev 9574)
+++ trunk/ao/src/plugins/oss/ao_oss.c	2005-07-16 21:28:13 UTC (rev 9575)
@@ -125,12 +125,13 @@
 				"  %s - %s\n",
 				err, dev,
 				strerror(errno), *dev_path); */
-		free(err);
-		free(dev);
 		free(*dev_path);
 		*dev_path = NULL;
 	}
 
+	if (err) free(err);
+	if (dev) free(dev);
+
 	return fd;
 }
 



More information about the commits mailing list