Skip to content

End the va_list before returning from _synctex_merge_strings.

Quipyowert2 requested to merge Quipyowert2/evince:va_list into master

This adds a va_end() call to _synctex_merge_strings in two places where it would return without ending the va_list first.

I added the va_end() calls since cppcheck complains that the va_list was not closed; the message it says is:

    Checking cut-n-paste\synctex\synctex_parser_utils.c ...                                                                 
    [cut-n-paste\synctex\synctex_parser_utils.c:428]: (error) Memory leak: core_name                                       
    [cut-n-paste\synctex\synctex_parser_utils.c:450]: (error) Memory leak: dir_name                                         
    [cut-n-paste\synctex\synctex_parser_utils.c:357]: (error) va_list 'arg' was opened but not closed by va_end().          
    Checking cut-n-paste\synctex\synctex_parser_utils.c: SYNCTEX_USE_SYSLOG...                                             
    Checking cut-n-paste\synctex\synctex_parser_utils.c: _WIN32...                                                       
    Checking cut-n-paste\synctex\synctex_parser_utils.c: _WIN32;__TOS_WIN__;__WIN32__;__WINDOWS__...                   
    Checking cut-n-paste\synctex\synctex_parser_utils.c: __OS2__...

According to man va_end, "each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function."

Merge request reports