diff --git a/csync/src/csync_statedb.c b/csync/src/csync_statedb.c index f62adcb05..c593b423d 100644 --- a/csync/src/csync_statedb.c +++ b/csync/src/csync_statedb.c @@ -69,12 +69,13 @@ static void _csync_win32_hide_file( const char *file ) { fileName = c_utf8_to_locale( file ); dwAttrs = GetFileAttributesW(fileName); - if (dwAttrs==INVALID_FILE_ATTRIBUTES) return; + if (dwAttrs==INVALID_FILE_ATTRIBUTES) goto cleanup; if (!(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) { SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN ); } +cleanup: c_free_locale_string(fileName); #else (void) file;