Commit 9faf36a6e89d1cc161bb6bf3afff7a3552b8a349

Nika Layzell 2018-06-14T22:48:58

mailmap: git_buf_free => git_buf_dispose

diff --git a/src/mailmap.c b/src/mailmap.c
index f249c52..b5fb7f6 100644
--- a/src/mailmap.c
+++ b/src/mailmap.c
@@ -265,10 +265,10 @@ int git_mailmap_add_buffer(git_mailmap *mm, const char *buf, size_t len)
 	}
 
 cleanup:
-	git_buf_free(&real_name);
-	git_buf_free(&real_email);
-	git_buf_free(&replace_name);
-	git_buf_free(&replace_email);
+	git_buf_dispose(&real_name);
+	git_buf_dispose(&real_email);
+	git_buf_dispose(&replace_name);
+	git_buf_dispose(&replace_email);
 	return error;
 }
 
@@ -313,7 +313,7 @@ static int mailmap_add_blob(
 		goto cleanup;
 
 cleanup:
-	git_buf_free(&content);
+	git_buf_dispose(&content);
 	git_blob_free(blob);
 	git_object_free(object);
 	return error;
@@ -340,8 +340,8 @@ static int mailmap_add_file_ondisk(
 		goto cleanup;
 
 cleanup:
-	git_buf_free(&fullpath);
-	git_buf_free(&content);
+	git_buf_dispose(&fullpath);
+	git_buf_dispose(&content);
 	return error;
 }
 
@@ -386,8 +386,8 @@ static void mailmap_add_from_repository(git_mailmap *mm, git_repository *repo)
 	if (path != NULL)
 		mailmap_add_file_ondisk(mm, path, repo);
 
-	git_buf_free(&rev_buf);
-	git_buf_free(&path_buf);
+	git_buf_dispose(&rev_buf);
+	git_buf_dispose(&path_buf);
 	git_config_free(config);
 }
 
diff --git a/tests/mailmap/parsing.c b/tests/mailmap/parsing.c
index 2cb8304..d3efe40 100644
--- a/tests/mailmap/parsing.c
+++ b/tests/mailmap/parsing.c
@@ -88,7 +88,7 @@ void test_mailmap_parsing__windows_string(void)
 	git_buf_text_lf_to_crlf(&winbuf, &unixbuf);
 
 	cl_git_pass(git_mailmap_from_buffer(&g_mailmap, winbuf.ptr, winbuf.size));
-	git_buf_free(&winbuf);
+	git_buf_dispose(&winbuf);
 
 	/* We should have parsed all of the entries */
 	check_mailmap_entries(g_mailmap, entries, ARRAY_SIZE(entries));