jlaurens / synctex

Synchronization for TeX
MIT License
57 stars 19 forks source link

End the va_list before returning from _synctex_merge_strings. #27

Closed Quipyowert2 closed 5 years ago

Quipyowert2 commented 5 years ago

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 synctex_parser_utils.c ...
[synctex_parser_utils.c:425]: (error) Memory leak: core_name
[synctex_parser_utils.c:447]: (error) Memory leak: dir_name
[synctex_parser_utils.c:354]: (error) va_list 'arg' was opened but not closed by va_end().
Checking synctex_parser_utils.c: SYNCTEX_USE_SYSLOG...
Checking synctex_parser_utils.c: _WIN32...
Checking synctex_parser_utils.c: _WIN32;__TOS_WIN__;__WIN32__;__WINDOWS__...
Checking 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."

I have already submitted this as a merge request to GNOME but they said to make an upstream pull request here.