diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-09-13 02:05:12 +0200 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-09-13 02:05:12 +0200 |
commit | 2aae21888133171e970b8f41bb6594b83c89238e (patch) | |
tree | 670ff37044e63e5e9e20e509e5ad9b9f817fdb3f /src | |
parent | 3f3f6225f8237e974b135de30eaac731c929936e (diff) | |
download | libgit2-2aae21888133171e970b8f41bb6594b83c89238e.tar.gz |
Add checks for NULL to the config and remote free functions
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 3 | ||||
-rw-r--r-- | src/remote.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 771250731..d686eb98a 100644 --- a/src/config.c +++ b/src/config.c @@ -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; diff --git a/src/remote.c b/src/remote.c index 297789a69..e9282bb9d 100644 --- a/src/remote.c +++ b/src/remote.c @@ -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); |