Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cppcheck highlighted this code. lib\formdata.c contains this code with two early returns either of which results in having memory pointed to my newform leaked.
lib\formdata.c
newform
static CURLcode AddFormData( PARAMS HERE) { struct FormData *newform = malloc(sizeof(struct FormData)); if(!newform) return CURLE_OUT_OF_MEMORY; newform->next = NULL; if(length < 0 || (size && *size < 0)) /* MEMORY LEAK - newform is not freed */ return CURLE_BAD_FUNCTION_ARGUMENT; if(type <= FORM_CONTENT) { if(!length) /*WHATEVER*/ else if(length >= (curl_off_t)(size_t)-1) /* MEMORY LEAK - newform is not freed */ return CURLE_BAD_FUNCTION_ARGUMENT;
The text was updated successfully, but these errors were encountered:
Yeps, seems like legitimate complaints...
Sorry, something went wrong.
c2a809c
thanks!
No branches or pull requests
Cppcheck highlighted this code.
lib\formdata.c
contains this code with two early returns either of which results in having memory pointed to mynewform
leaked.The text was updated successfully, but these errors were encountered: