@@ -40,7 +40,7 @@ static int retrieve_branch_reference(
4040
4141 * branch_reference_out = branch ; /* will be NULL on error */
4242
43- git_buf_free (& ref_name );
43+ git_buf_dispose (& ref_name );
4444 return error ;
4545}
4646
@@ -108,8 +108,8 @@ static int create_branch(
108108 * ref_out = branch ;
109109
110110cleanup :
111- git_buf_free (& canonical_branch_name );
112- git_buf_free (& log_message );
111+ git_buf_dispose (& canonical_branch_name );
112+ git_buf_dispose (& log_message );
113113 return error ;
114114}
115115
@@ -199,7 +199,7 @@ int git_branch_delete(git_reference *branch)
199199 error = git_reference_delete (branch );
200200
201201on_error :
202- git_buf_free (& config_section );
202+ git_buf_dispose (& config_section );
203203 return error ;
204204}
205205
@@ -310,10 +310,10 @@ int git_branch_move(
310310 git_buf_cstr (& new_config_section ));
311311
312312done :
313- git_buf_free (& new_reference_name );
314- git_buf_free (& old_config_section );
315- git_buf_free (& new_config_section );
316- git_buf_free (& log_message );
313+ git_buf_dispose (& new_reference_name );
314+ git_buf_dispose (& old_config_section );
315+ git_buf_dispose (& new_config_section );
316+ git_buf_dispose (& log_message );
317317
318318 return error ;
319319}
@@ -366,7 +366,7 @@ static int retrieve_upstream_configuration(
366366 return -1 ;
367367
368368 error = git_config_get_string_buf (out , config , git_buf_cstr (& buf ));
369- git_buf_free (& buf );
369+ git_buf_dispose (& buf );
370370 return error ;
371371}
372372
@@ -429,9 +429,9 @@ int git_branch_upstream_name(
429429cleanup :
430430 git_config_free (config );
431431 git_remote_free (remote );
432- git_buf_free (& remote_name );
433- git_buf_free (& merge_name );
434- git_buf_free (& buf );
432+ git_buf_dispose (& remote_name );
433+ git_buf_dispose (& merge_name );
434+ git_buf_dispose (& buf );
435435 return error ;
436436}
437437
@@ -522,7 +522,7 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
522522
523523cleanup :
524524 if (error < 0 )
525- git_buf_free (buf );
525+ git_buf_dispose (buf );
526526
527527 git_strarray_free (& remote_list );
528528 return error ;
@@ -544,7 +544,7 @@ int git_branch_upstream(
544544 git_reference_owner (branch ),
545545 git_buf_cstr (& tracking_name ));
546546
547- git_buf_free (& tracking_name );
547+ git_buf_dispose (& tracking_name );
548548 return error ;
549549}
550550
@@ -565,11 +565,11 @@ static int unset_upstream(git_config *config, const char *shortname)
565565 if (git_config_delete_entry (config , git_buf_cstr (& buf )) < 0 )
566566 goto on_error ;
567567
568- git_buf_free (& buf );
568+ git_buf_dispose (& buf );
569569 return 0 ;
570570
571571on_error :
572- git_buf_free (& buf );
572+ git_buf_dispose (& buf );
573573 return -1 ;
574574}
575575
@@ -655,15 +655,15 @@ int git_branch_set_upstream(git_reference *branch, const char *upstream_name)
655655 goto on_error ;
656656
657657 git_reference_free (upstream );
658- git_buf_free (& key );
659- git_buf_free (& value );
658+ git_buf_dispose (& key );
659+ git_buf_dispose (& value );
660660
661661 return 0 ;
662662
663663on_error :
664664 git_reference_free (upstream );
665- git_buf_free (& key );
666- git_buf_free (& value );
665+ git_buf_dispose (& key );
666+ git_buf_dispose (& value );
667667 git_remote_free (remote );
668668
669669 return -1 ;
0 commit comments