Skip to content

Commit

Permalink
Print: stop leaking dinfo allocated by cupsCopyDestInfo()
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
LebedevRI committed May 23, 2015
1 parent be3b2c8 commit ed430c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/cups_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ GList *dt_get_papers(const char *printer_name)
}
}
}

cupsFreeDestInfo(info);
}
else
dt_print(DT_DEBUG_PRINT, "[print] cannot connect to printer %s (cancel=%d)\n", printer_name, cancel);
Expand Down

0 comments on commit ed430c4

Please sign in to comment.