X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/5f2df4d2f5bcc2de91f10fc752968e63c7118d8c..d6430b975d14ddbd53c40126fa9d00bea3c2d08b:/winstore.c diff --git a/winstore.c b/winstore.c index d4800796..bc7bb5b1 100644 --- a/winstore.c +++ b/winstore.c @@ -198,14 +198,14 @@ char *enum_settings_next(void *handle, char *buffer, int buflen) struct enumsettings *e = (struct enumsettings *) handle; char *otherbuf; otherbuf = smalloc(3 * buflen); - if (otherbuf && RegEnumKey(e->key, e->i++, otherbuf, - 3 * buflen) == ERROR_SUCCESS) { + if (RegEnumKey(e->key, e->i++, otherbuf, 3 * buflen) == ERROR_SUCCESS) { unmungestr(otherbuf, buffer, buflen); sfree(otherbuf); return buffer; - } else + } else { + sfree(otherbuf); return NULL; - + } } void enum_settings_finish(void *handle)