fmt-merge-msg: avoid leaking strbuf in shortlog()
Use string_list_append_nodup() instead of string_list_append() to hand over ownership of a detached strbuf and thus avoid leaking its memory. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									9752ad0bb7
								
							
						
					
					
						commit
						addcf6cfde
					
				|  | @ -376,7 +376,8 @@ static void shortlog(const char *name, | ||||||
| 			string_list_append(&subjects, | 			string_list_append(&subjects, | ||||||
| 					   oid_to_hex(&commit->object.oid)); | 					   oid_to_hex(&commit->object.oid)); | ||||||
| 		else | 		else | ||||||
| 			string_list_append(&subjects, strbuf_detach(&sb, NULL)); | 			string_list_append_nodup(&subjects, | ||||||
|  | 						 strbuf_detach(&sb, NULL)); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (opts->credit_people) | 	if (opts->credit_people) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 René Scharfe
						René Scharfe