I tested it with imlib2 1.4.10, there is no memleak:
==2591== Memcheck, a memory error detector
==2591== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2591== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==2591== Command: ./a.out
==2591==
==2591==
==2591== HEAP SUMMARY:
==2591== in use at exit: 232 bytes in 3 blocks
==2591== total heap usage: 256 allocs, 253 frees, 78,952 bytes allocated
==2591==
==2591== 16 bytes in 1 blocks are still reachable in loss record 1 of 3
==2591== at 0x4C2BBEF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2591== by 0x4E3E4B9: imlib_context_push (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x4E3F867: imlib_load_image (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x1088AA: main (main.c:3)
==2591==
==2591== 32 bytes in 1 blocks are still reachable in loss record 2 of 3
==2591== at 0x4C2DC05: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2591== by 0x56F360E: _dlerror_run (dlerror.c:141)
==2591== by 0x56F2F81: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
==2591== by 0x4E5A25A: ??? (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x4E5B0FE: ??? (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x4E3F840: imlib_load_image (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x1088AA: main (main.c:3)
==2591==
==2591== 184 bytes in 1 blocks are still reachable in loss record 3 of 3
==2591== at 0x4C2BBEF: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2591== by 0x4E3E39D: imlib_context_new (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x4E3F85C: imlib_load_image (in
/usr/lib/x86_64-linux-gnu/libImlib2.so.1.4.10)
==2591== by 0x1088AA: main (main.c:3)
==2591==
==2591== LEAK SUMMARY:
==2591== definitely lost: 0 bytes in 0 blocks
==2591== indirectly lost: 0 bytes in 0 blocks
==2591== possibly lost: 0 bytes in 0 blocks
==2591== still reachable: 232 bytes in 3 blocks
==2591== suppressed: 0 bytes in 0 blocks
==2591==
==2591== For counts of detected and suppressed errors, rerun with: -v
==2591== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)