Skip to content

Commit ed430c4

Browse files
committed
Print: stop leaking dinfo allocated by cupsCopyDestInfo()
Fixes LeakSanitizer-detected leaks like: Direct leak of 264 byte(s) in 1 object(s) allocated from: #0 0x7fbe6c634895 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54895) #1 0x7fbe64fe8def in cupsCopyDestInfo (/usr/lib/x86_64-linux-gnu/libcups.so.2+0x28def) #2 0x7fbe6c408d5c in dt_get_papers /home/lebedevri/darktable/src/common/cups_print.c:205 #3 0x7fbe3fee610e #4 0x7fbe3fee9cc2 #5 0x7fbe6c3a2d07 in dt_lib_load_modules /home/lebedevri/darktable/src/libs/lib.c:718 #6 0x7fbe6c3a55d6 in dt_lib_init /home/lebedevri/darktable/src/libs/lib.c:1008 #7 0x7fbe6c19e917 in dt_init /home/lebedevri/darktable/src/common/darktable.c:889 #8 0x400cb8 in main /home/lebedevri/darktable/src/main.c:24 #9 0x7fbe64a09b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44) #10 0x400bd8 (/usr/local/bin/darktable+0x400bd8)
1 parent be3b2c8 commit ed430c4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/common/cups_print.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ GList *dt_get_papers(const char *printer_name)
227227
}
228228
}
229229
}
230+
231+
cupsFreeDestInfo(info);
230232
}
231233
else
232234
dt_print(DT_DEBUG_PRINT, "[print] cannot connect to printer %s (cancel=%d)\n", printer_name, cancel);

0 commit comments

Comments
 (0)