Esme Povirk (@madewokherd) commented about dlls/shell32/shlfileop.c:
- *out = calloc(1, sizeof(struct file_operation));
- if (!*out)
- {
ret = E_OUTOFMEMORY;
goto end;
- }
- (*out)->wFunc = func;
- (*out)->pFrom = from;
- (*out)->pTo = to;
- return ret;
+end:
- if (from) free(from);
- if (to) free(to);
It's not necessary to check for NULL before calling `free`.