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
581cfbda
Commit
581cfbda
authored
Sep 23, 2021
by
Paymon MARANDI
Committed by
jrun
Sep 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: Free the git_config and git_config_entry after use
parent
13690108
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
examples/config.c
+9
-0
No files found.
examples/config.c
View file @
581cfbda
...
@@ -26,6 +26,10 @@ static int config_get(git_config *cfg, const char *key)
...
@@ -26,6 +26,10 @@ static int config_get(git_config *cfg, const char *key)
}
}
puts
(
entry
->
value
);
puts
(
entry
->
value
);
/* Free the git_config_entry after use with `git_config_entry_free()`. */
git_config_entry_free
(
entry
);
return
0
;
return
0
;
}
}
...
@@ -57,6 +61,11 @@ int lg2_config(git_repository *repo, int argc, char **argv)
...
@@ -57,6 +61,11 @@ int lg2_config(git_repository *repo, int argc, char **argv)
error
=
1
;
error
=
1
;
}
}
/**
* The configuration file must be freed once it's no longer
* being used by the user.
*/
git_config_free
(
cfg
);
out:
out:
return
error
;
return
error
;
}
}
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