index_server: Fix obvious memory leak in CLuceneDataBase

Signed-off-by: Alexander von Gluck IV <kallisti5@unixzen.com>
This commit is contained in:
Viktor Muntzing 2016-01-08 16:26:17 -06:00 committed by Alexander von Gluck IV
parent 59b0036e71
commit fd5d0900da
1 changed files with 3 additions and 2 deletions

View File

@ -35,9 +35,10 @@ wchar_t* to_wchar(const char *str)
int size = strlen(str) * sizeof(wchar_t) ;
wchar_t *wStr = new wchar_t[size] ;
if (mbstowcs(wStr, str, size) == -1)
if (mbstowcs(wStr, str, size) == -1) {
delete[] wStr ;
return NULL ;
else
} else
return wStr ;
}