mirror of
https://github.com/moparisthebest/curl
synced 2024-11-11 12:05:06 -05:00
slightly better dealing of bad mem situations
This commit is contained in:
parent
63f97b38eb
commit
7a35fb5403
11
src/main.c
11
src/main.c
@ -769,6 +769,10 @@ static int formparse(char *input,
|
|||||||
|
|
||||||
/* Allocate the contents */
|
/* Allocate the contents */
|
||||||
contents = strdup(contp+1);
|
contents = strdup(contp+1);
|
||||||
|
if(!contents) {
|
||||||
|
fprintf(stderr, "out of memory\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
contp = contents;
|
contp = contents;
|
||||||
|
|
||||||
if('@' == contp[0]) {
|
if('@' == contp[0]) {
|
||||||
@ -2927,6 +2931,8 @@ operate(struct Configurable *config, int argc, char *argv[])
|
|||||||
(config->errors?config->errors:stderr):NULL);
|
(config->errors?config->errors:stderr):NULL);
|
||||||
if(res != CURLE_OK) {
|
if(res != CURLE_OK) {
|
||||||
clean_getout(config);
|
clean_getout(config);
|
||||||
|
if(outfiles)
|
||||||
|
free(outfiles);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3021,10 +3027,9 @@ operate(struct Configurable *config, int argc, char *argv[])
|
|||||||
/* Create the directory hierarchy, if not pre-existant to a multiple
|
/* Create the directory hierarchy, if not pre-existant to a multiple
|
||||||
file output call */
|
file output call */
|
||||||
|
|
||||||
if(config->create_dirs)
|
if(config->create_dirs &&
|
||||||
if (-1 == create_dir_hierarchy(outfile)) {
|
(-1 == create_dir_hierarchy(outfile)))
|
||||||
return CURLE_WRITE_ERROR;
|
return CURLE_WRITE_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
if(config->resume_from_current) {
|
if(config->resume_from_current) {
|
||||||
/* We're told to continue from where we are now. Get the
|
/* We're told to continue from where we are now. Get the
|
||||||
|
Loading…
Reference in New Issue
Block a user