summaryrefslogtreecommitdiff
path: root/src/strarray.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-29 13:13:19 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-06-01 22:50:28 +0100
commit51eff5a58b95f91cbdd8e5caa750964c9f08e895 (patch)
tree64cebe7a2646eacd6c1fdd068a17213fef39c23b /src/strarray.c
parenta9746b306d32cc2d2bc5d446f6f7ae7c7068ba79 (diff)
downloadlibgit2-51eff5a58b95f91cbdd8e5caa750964c9f08e895.tar.gz
strarray: we should `dispose` instead of `free`
We _dispose_ the contents of objects; we _free_ objects (and their contents). Update `git_strarray_free` to be `git_strarray_dispose`. `git_strarray_free` remains as a deprecated proxy function.
Diffstat (limited to 'src/strarray.c')
-rw-r--r--src/strarray.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/strarray.c b/src/strarray.c
index ebd581483..7ad413404 100644
--- a/src/strarray.c
+++ b/src/strarray.c
@@ -29,7 +29,7 @@ int git_strarray_copy(git_strarray *tgt, const git_strarray *src)
tgt->strings[tgt->count] = git__strdup(src->strings[i]);
if (!tgt->strings[tgt->count]) {
- git_strarray_free(tgt);
+ git_strarray_dispose(tgt);
memset(tgt, 0, sizeof(*tgt));
return -1;
}
@@ -40,7 +40,7 @@ int git_strarray_copy(git_strarray *tgt, const git_strarray *src)
return 0;
}
-void git_strarray_free(git_strarray *array)
+void git_strarray_dispose(git_strarray *array)
{
size_t i;
@@ -54,3 +54,8 @@ void git_strarray_free(git_strarray *array)
memset(array, 0, sizeof(*array));
}
+
+void git_strarray_free(git_strarray *array)
+{
+ git_strarray_dispose(array);
+}