changeset 32694:3c1c3676df94

Fix uCode memleak found by debian automated code analysis
author ranma
date Tue, 11 Jan 2011 00:12:20 +0000
parents 2290be558d55
children 5f69ed383ff1
files libvo/vo_dxr2.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_dxr2.c	Tue Jan 11 00:09:59 2011 +0000
+++ b/libvo/vo_dxr2.c	Tue Jan 11 00:12:20 2011 +0000
@@ -897,6 +897,7 @@
   if (read(uCodeFD, uCode+4, uCodeSize) != uCodeSize) {
 
     mp_msg(MSGT_VO,MSGL_ERR,"VO: [dxr2] Could not read uCode uCode: %s\n", strerror(errno));
+    free(uCode);
     return VO_ERROR;
   }
   close(uCodeFD);
@@ -916,6 +917,8 @@
     crop.arg4=0;
     ioctl(dxr2_fd, DXR2_IOC_SET_OVERLAY_CROPPING, &crop);
   }
+
+  free(uCode);
   return 0;
 }