More Issues.

--- a\src\win\iupwin_list.c     Mon Dec 11 14:52:42 2017
+++ b\src\win\iupwin_list.c     Wed Jan 24 23:01:01 2018
@@ -962,12 +962,14 @@
 
 static int winListSetImageAttrib(Ihandle* ih, int id, const char* value)
 {
-  HBITMAP hBitmap = iupImageGetImage(value, ih, 0);
+  HBITMAP hBitmap;
   int pos = iupListGetPosAttrib(ih, id);
 
   if (!ih->data->show_image || pos < 0)
+  {
     return 0;
-
+  }
+  hBitmap = iupImageGetImage(value, ih, 0);
   winListSetItemData(ih, pos, NULL, hBitmap);
 
   iupdrvRedrawNow(ih);
@@ -1637,6 +1639,7 @@
       *result = 0;
       return 1;
     }
+    break;
   case WM_SETFOCUS:
   case WM_KILLFOCUS:
   case WM_MOUSELEAVE:

________________________________________
De: Ranier VF <ranier_...@hotmail.com>
Enviado: quinta-feira, 25 de janeiro de 2018 00:35
Para: IUP discussion list.
Assunto: [Iup-users] IUP 3.24 RESOURCE LEAK (iupwin_list.c)

Hi,
Issue found by Coverity Scan.
CID 259212 (#1 of 1): Resource leak (RESOURCE_LEAK)
4. leaked_handle: Handle variable hBitmap going out of scope leaks the handle.

--- a\src\win\iupwin_list.c     Mon Dec 11 14:52:42 2017
+++ b\src\win\iupwin_list.c     Wed Jan 24 22:35:04 2018
@@ -962,12 +962,14 @@

 static int winListSetImageAttrib(Ihandle* ih, int id, const char* value)
 {
-  HBITMAP hBitmap = iupImageGetImage(value, ih, 0);
+  HBITMAP hBitmap;
   int pos = iupListGetPosAttrib(ih, id);

   if (!ih->data->show_image || pos < 0)
+  {
     return 0;
-
+  }
+  hBitmap = iupImageGetImage(value, ih, 0);
   winListSetItemData(ih, pos, NULL, hBitmap);

   iupdrvRedrawNow(ih);

Best.
Ranier Vilela
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Attachment: iupwin_list.patch
Description: iupwin_list.patch

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to