Commit db354b7
committed
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>1 parent fda3e2c commit db354b7
1 file changed
+0
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
957 | 956 | | |
958 | 957 | | |
959 | | - | |
960 | | - | |
961 | 958 | | |
962 | 959 | | |
963 | 960 | | |
964 | 961 | | |
965 | 962 | | |
966 | | - | |
967 | 963 | | |
968 | 964 | | |
969 | | - | |
970 | | - | |
971 | 965 | | |
972 | 966 | | |
973 | 967 | | |
| |||
0 commit comments