[C][Client][Clang Static Analyzer] Fix memory leak before function returnning (#7302)

This commit is contained in:
Hui Yu 2020-08-27 09:38:22 +08:00 committed by GitHub
parent 11a674f248
commit f11b2e6772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -470,6 +470,7 @@ end:
{{/formParams}} {{/formParams}}
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
{{/returnType}} {{/returnType}}
{{^returnType}} {{^returnType}}

View File

@ -271,6 +271,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status )
free(localVarPath); free(localVarPath);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -352,6 +353,7 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags )
free(localVarPath); free(localVarPath);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -435,6 +437,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId )
free(localVarToReplace_petId); free(localVarToReplace_petId);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -702,6 +705,7 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata
free(keyPairForm_file); free(keyPairForm_file);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }

View File

@ -134,6 +134,7 @@ StoreAPI_getInventory(apiClient_t *apiClient)
free(localVarPath); free(localVarPath);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -217,6 +218,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId )
free(localVarToReplace_orderId); free(localVarToReplace_orderId);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -291,6 +293,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body )
free(localVarBodyParameters); free(localVarBodyParameters);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }

View File

@ -372,6 +372,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username )
free(localVarToReplace_username); free(localVarToReplace_username);
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }
@ -477,6 +478,7 @@ UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password )
} }
return elementToReturn; return elementToReturn;
end: end:
free(localVarPath);
return NULL; return NULL;
} }