mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-18 18:19:34 +00:00
Add checks for NULL to the config and remote free functions
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
3f3f6225f8
commit
2aae218881
@ -43,6 +43,9 @@ void git_config_free(git_config *cfg)
|
||||
git_config_file *file;
|
||||
file_internal *internal;
|
||||
|
||||
if (cfg == NULL)
|
||||
return;
|
||||
|
||||
for(i = 0; i < cfg->files.length; ++i){
|
||||
internal = git_vector_get(&cfg->files, i);
|
||||
file = internal->file;
|
||||
|
@ -267,6 +267,9 @@ int git_remote_update_tips(struct git_remote *remote)
|
||||
|
||||
void git_remote_free(git_remote *remote)
|
||||
{
|
||||
if (remote == NULL)
|
||||
return;
|
||||
|
||||
free(remote->fetch.src);
|
||||
free(remote->fetch.dst);
|
||||
free(remote->push.src);
|
||||
|
Loading…
Reference in New Issue
Block a user