]> granicus.if.org Git - curl/commitdiff
curl: "Dereference of null pointer"
authorPatrick Monnerat <patrick@monnerat.net>
Wed, 13 Feb 2019 17:44:17 +0000 (18:44 +0100)
committerPatrick Monnerat <patrick@monnerat.net>
Wed, 13 Feb 2019 17:44:17 +0000 (18:44 +0100)
Rephrase to satisfy scan-build.

src/tool_formparse.c

index 537c6ca93b4b93b8163c3f3b7821e026fc39e7db..bba1d07e762c7611e9215ffaf6b3faf64405a9da 100644 (file)
@@ -628,7 +628,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
 }
 #define SET_TOOL_MIME_PTR(m, field, retcode) {                          \
   if(field)                                                             \
-    NULL_CHECK(m->field, strdup(field), retcode);                       \
+    NULL_CHECK((m)->field, strdup(field), retcode);                     \
 }
 
 int formparse(struct OperationConfig *config,
@@ -651,7 +651,7 @@ int formparse(struct OperationConfig *config,
   CURLcode res;
 
   /* Allocate the main mime structure if needed. */
-  if(!*mimepost) {
+  if(!*mimecurrent) {
     NULL_CHECK(*mimepost, tool_mime_new_parts(NULL), 1);
     *mimecurrent = *mimepost;
   }