diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 463bfddc1e20..3752fcfce1e1 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -470,6 +470,7 @@ end: {{/formParams}} return elementToReturn; end: + free(localVarPath); return NULL; {{/returnType}} {{^returnType}} diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 37ac5b1dc32a..aa3db38496a3 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -271,6 +271,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) free(localVarPath); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -352,6 +353,7 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) free(localVarPath); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -435,6 +437,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId ) free(localVarToReplace_petId); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -702,6 +705,7 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata free(keyPairForm_file); return elementToReturn; end: + free(localVarPath); return NULL; } diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index 8439ec11d7d2..9d8a539c304c 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -134,6 +134,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) free(localVarPath); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -217,6 +218,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) free(localVarToReplace_orderId); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -291,6 +293,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) free(localVarBodyParameters); return elementToReturn; end: + free(localVarPath); return NULL; } diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index 7c652752fb54..5fdba8bc2a72 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -372,6 +372,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username ) free(localVarToReplace_username); return elementToReturn; end: + free(localVarPath); return NULL; } @@ -477,6 +478,7 @@ UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) } return elementToReturn; end: + free(localVarPath); return NULL; }