summaryrefslogtreecommitdiff
path: root/line-range.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-03-22 14:41:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-03-22 14:41:08 -0700
commitdb354b7f1be0d6d7b8cd85800f83a1d2d90cc4a5 (patch)
treef51571c8feeec599fd5e1312996cb66ea38a959a /line-range.h
parentbuiltin/apply: get rid of useless 'name' variable (diff)
downloadtgif-db354b7f1be0d6d7b8cd85800f83a1d2d90cc4a5.tar.xz
apply: remove unused call to free() in gitdiff_{old,new}name()
These two functions keep a copy of filename it was given, let gitdiff_verify_name() to rewrite it to a new filename and then free the original if they receive a newly minted filename. However (1) when the original name is NULL, gitdiff_verify_name() returns either NULL or a newly minted value. Either case, we do not have to worry about calling free() on the original NULL. (2) when the original name is not NULL, gitdiff_verify_name() either returns that as-is, or calls die() when it finds inconsistency in the patch. When the function returns, we know that "if ()" statement always is false. Noticed by Christian Couder. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'line-range.h')
0 files changed, 0 insertions, 0 deletions