Fix gcc12 warning in __imlib_ConsumeImage()

Although the warning is technically correct it is not a problem as the
address is just used to match if an ImlibImagePixmap references it.

../../../../src/lib/image.c: In function ‘__imlib_ConsumeImage’:
../../../../src/lib/image.c:111:4: error: pointer ‘im’ used after ‘free’ [-Werror=use-after-free]
  111 |    __imlib_PixmapUnrefImage(im);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/lib/image.c:108:4: note: call to ‘free’ here
  108 |    free(im);
      |    ^~~~~~~~
This commit is contained in:
Kim Woelders 2022-01-29 16:44:13 +01:00
parent 4384b8ee43
commit 749c6ab254
1 changed files with 4 additions and 4 deletions

View File

@ -95,6 +95,10 @@ __imlib_ProduceImage(void)
static void
__imlib_ConsumeImage(ImlibImage * im)
{
#ifdef BUILD_X11
__imlib_PixmapUnrefImage(im);
#endif
__imlib_FreeAllTags(im);
if (im->real_file && im->real_file != im->file)
@ -106,10 +110,6 @@ __imlib_ConsumeImage(ImlibImage * im)
free(im->format);
free(im);
#ifdef BUILD_X11
__imlib_PixmapUnrefImage(im);
#endif
}
static ImlibImage *