Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
ca6f203c
Commit
ca6f203c
authored
Jul 12, 2011
by
schu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reference_rename: make sure old_name gets freed
Signed-off-by: schu <schu-github@schulog.org>
parent
b08683ff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
src/refs.c
+3
-1
No files found.
src/refs.c
View file @
ca6f203c
...
@@ -1290,7 +1290,7 @@ int git_reference_set_target(git_reference *ref, const char *target)
...
@@ -1290,7 +1290,7 @@ int git_reference_set_target(git_reference *ref, const char *target)
int
git_reference_rename
(
git_reference
*
ref
,
const
char
*
new_name
,
int
force
)
int
git_reference_rename
(
git_reference
*
ref
,
const
char
*
new_name
,
int
force
)
{
{
int
error
;
int
error
;
char
*
old_name
=
git__strdup
(
ref
->
name
)
;
char
*
old_name
=
NULL
;
char
aux_path
[
GIT_PATH_MAX
];
char
aux_path
[
GIT_PATH_MAX
];
char
normalized
[
GIT_REFNAME_MAX
];
char
normalized
[
GIT_REFNAME_MAX
];
...
@@ -1328,6 +1328,8 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
...
@@ -1328,6 +1328,8 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
* the new reference, e.g. when renaming foo/bar -> foo.
* the new reference, e.g. when renaming foo/bar -> foo.
*/
*/
old_name
=
git__strdup
(
ref
->
name
);
if
(
ref
->
type
&
GIT_REF_SYMBOLIC
)
{
if
(
ref
->
type
&
GIT_REF_SYMBOLIC
)
{
if
((
target_ref
=
git_reference_target
(
ref
))
==
NULL
)
if
((
target_ref
=
git_reference_target
(
ref
))
==
NULL
)
goto
cleanup
;
goto
cleanup
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment