Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
ec45d0d2
Commit
ec45d0d2
authored
Jan 10, 2008
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve errno on talloc_free
parent
4f2616ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
talloc/talloc.c
talloc/talloc.c
+5
-1
talloc/talloc.h
talloc/talloc.h
+1
-0
No files found.
talloc/talloc.c
View file @
ec45d0d2
...
...
@@ -730,7 +730,11 @@ void *talloc_named_const(const void *context, size_t size, const char *name)
*/
int
talloc_free
(
void
*
ptr
)
{
return
_talloc_free
(
ptr
);
int
saved_errno
=
errno
,
ret
;
ret
=
_talloc_free
(
ptr
);
if
(
ret
==
0
)
errno
=
saved_errno
;
return
ret
;
}
...
...
talloc/talloc.h
View file @
ec45d0d2
...
...
@@ -100,6 +100,7 @@
* returned for success and -1 for failure. The only possible failure condition
* is if the pointer had a destructor attached to it and the destructor
* returned -1. See talloc_set_destructor() for details on destructors.
* errno will be preserved unless the talloc_free fails.
*
* If this pointer has an additional parent when talloc_free() is called then
* the memory is not actually released, but instead the most recently
...
...
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