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

Reply via email to