Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hiro
Tor
Commits
051cda80
Commit
051cda80
authored
20 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
point out a potential thread/process leak problem when we're out of memory
svn:r3512
parent
bcece3d8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/util.c
+5
-0
5 additions, 0 deletions
src/common/util.c
with
5 additions
and
0 deletions
src/common/util.c
+
5
−
0
View file @
051cda80
...
...
@@ -103,6 +103,9 @@ const char util_c_id[] = "$Id$";
/** Allocate a chunk of <b>size</b> bytes of memory, and return a pointer to
* result. On error, log and terminate the process. (Same as malloc(size),
* but never returns NULL.)
*
* <b>file</b> and <b>line</b> are used if dmalloc is enabled, and
* ignored otherwise.
*/
void
*
_tor_malloc
(
const
char
*
file
,
const
int
line
,
size_t
size
)
{
void
*
result
;
...
...
@@ -115,6 +118,8 @@ void *_tor_malloc(const char *file, const int line, size_t size) {
if
(
!
result
)
{
log_fn
(
LOG_ERR
,
"Out of memory. Dying."
);
/* XXX if these functions die within a worker process, they won't
* call spawn_exit */
exit
(
1
);
}
// memset(result,'X',size); /* deadbeef to encourage bugs */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment