* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
#include "formdata.h"
#include "vtls/vtls.h"
#include "strequal.h"
-#include "curl_memory.h"
#include "sendf.h"
#include "strdup.h"
+#include "curl_printf.h"
-#define _MPRINTF_REPLACE /* use our functions only */
-#include <curl/mprintf.h>
-
-/* The last #include file should be: */
+/* The last #include files should be: */
+#include "curl_memory.h"
#include "memdebug.h"
#ifndef HAVE_BASENAME
else {
form = AddFormInfo(fname, NULL, current_form);
if(!form) {
- Curl_safefree(fname);
+ free(fname);
return_value = CURL_FORMADD_MEMORY;
}
else {
else {
form = AddFormInfo(NULL, type, current_form);
if(!form) {
- Curl_safefree(type);
+ free(type);
return_value = CURL_FORMADD_MEMORY;
}
else {
now by the httppost linked list */
while(first_form) {
FormInfo *ptr = first_form->more;
- Curl_safefree(first_form);
+ free(first_form);
first_form = ptr;
}
int ret_stat;
FILE * file;
- file = fopen(name, "r");
+ file = fopen(name, "r"); /* VMS */
if(file == NULL)
return 0;
next=form->next; /* the following form line */
/* recurse to sub-contents */
- if(form->more)
- curl_formfree(form->more);
+ curl_formfree(form->more);
- if(!(form->flags & HTTPPOST_PTRNAME) && form->name)
+ if(!(form->flags & HTTPPOST_PTRNAME))
free(form->name); /* free the name */
if(!(form->flags &
- (HTTPPOST_PTRCONTENTS|HTTPPOST_BUFFER|HTTPPOST_CALLBACK)) &&
- form->contents)
+ (HTTPPOST_PTRCONTENTS|HTTPPOST_BUFFER|HTTPPOST_CALLBACK))
+ )
free(form->contents); /* free the contents */
- if(form->contenttype)
- free(form->contenttype); /* free the content type */
- if(form->showfilename)
- free(form->showfilename); /* free the faked file name */
+ free(form->contenttype); /* free the content type */
+ free(form->showfilename); /* free the faked file name */
free(form); /* free the struct */
} while((form = next) != NULL); /* continue */
/* filename need be escaped */
filename_escaped = malloc(strlen(filename)*2+1);
if(!filename_escaped) {
- Curl_safefree(filebasename);
+ free(filebasename);
return CURLE_OUT_OF_MEMORY;
}
p0 = filename_escaped;
result = AddFormDataf(form, size,
"; filename=\"%s\"",
filename);
- Curl_safefree(filename_escaped);
- Curl_safefree(filebasename);
+ free(filename_escaped);
+ free(filebasename);
return result;
}
boundary);
if(result) {
- Curl_safefree(boundary);
+ free(boundary);
return result;
}
/* we DO NOT include that line in the total size of the POST, since it'll be
/* If used, this is a link to more file names, we must then do
the magic to include several files with the same field name */
- Curl_safefree(fileboundary);
+ free(fileboundary);
fileboundary = formboundary(data);
if(!fileboundary) {
result = CURLE_OUT_OF_MEMORY;
if(result) {
Curl_formclean(&firstform);
- Curl_safefree(fileboundary);
- Curl_safefree(boundary);
+ free(fileboundary);
+ free(boundary);
return result;
}
*sizep = size;
- Curl_safefree(fileboundary);
- Curl_safefree(boundary);
+ free(fileboundary);
+ free(boundary);
*finalform = firstform;
case FAB$C_VAR:
case FAB$C_VFC:
case FAB$C_STMCR:
- return fopen(file, "r");
+ return fopen(file, "r"); /* VMS */
break;
default:
return fopen(file, "r", "rfm=stmlf", "ctx=stm");