tool_main: Fixed a memory leak on main_init error
authorDan Fandrich <dan@coneharvesters.com>
Fri, 28 Feb 2014 20:57:04 +0000 (21:57 +0100)
committerDan Fandrich <dan@coneharvesters.com>
Fri, 28 Feb 2014 20:58:12 +0000 (21:58 +0100)
src/tool_main.c

index 955e479..1e9156a 100644 (file)
@@ -154,13 +154,18 @@ static CURLcode main_init(struct GlobalConfig *config)
         else {
           helpf(stderr, "error initializing curl easy handle\n");
           result = CURLE_FAILED_INIT;
+          free(config->first);
         }
       }
-      else
+      else {
         helpf(stderr, "error retrieving curl library information\n");
+        free(config->first);
+      }
     }
-    else
+    else {
       helpf(stderr, "error initializing curl library\n");
+      free(config->first);
+    }
   }
   else {
     helpf(stderr, "error initializing curl\n");