[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
4 changed files with 10 additions and 0 deletions

View File

@@ -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;
}