Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
pikelang
pike
Commits
104730b3
Commit
104730b3
authored
24 years ago
by
Fredrik Hübinette (Hubbe)
Browse files
Options
Downloads
Patches
Plain Diff
fixed memory leak in Pipe.pipe [bug 65]
Rev: src/modules/Pipe/pipe.c:1.43
parent
41dc863d
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/modules/Pipe/pipe.c
+19
-2
19 additions, 2 deletions
src/modules/Pipe/pipe.c
with
19 additions
and
2 deletions
src/modules/Pipe/pipe.c
+
19
−
2
View file @
104730b3
...
...
@@ -30,7 +30,7 @@
#include
<fcntl.h>
RCSID
(
"$Id: pipe.c,v 1.4
2
2000/08/
19 11:18:12 gr
ubb
a
Exp $"
);
RCSID
(
"$Id: pipe.c,v 1.4
3
2000/08/
28 22:13:09 h
ubb
e
Exp $"
);
#include
"threads.h"
#include
"stralloc.h"
...
...
@@ -220,6 +220,8 @@ static INLINE struct input *new_input(void)
/* Free an input struct and all that it stands for */
static
INLINE
void
free_input
(
struct
input
*
i
)
{
debug_malloc_touch
(
i
);
ninputs
--
;
switch
(
i
->
type
)
{
...
...
@@ -300,6 +302,8 @@ static INLINE int append_buffer(struct pike_string *s)
{
struct
buffer
*
b
;
debug_malloc_touch
(
s
);
if
(
THIS
->
fd
!=
-
1
)
{
fd_lseek
(
THIS
->
fd
,
THIS
->
pos
,
SEEK_SET
);
...
...
@@ -576,6 +580,8 @@ static INLINE void output_finish(struct object *obj)
struct
output
*
o
,
*
oi
;
struct
object
*
obji
;
debug_malloc_touch
(
obj
);
o
=
(
struct
output
*
)(
obj
->
storage
);
if
(
o
->
obj
)
...
...
@@ -629,6 +635,8 @@ static INLINE void output_try_write_some(struct object *obj)
size_t
len
;
INT_TYPE
ret
;
debug_malloc_touch
(
obj
);
out
=
(
struct
output
*
)(
obj
->
storage
);
#ifdef INSISTANT_WRITE
...
...
@@ -944,7 +952,7 @@ static void pipe_output(INT32 args)
else
o
->
pos
=
THIS
->
pos
;
ref_
push_object
(
obj
);
push_object
(
obj
);
/* Ok, David, this is probably correct, but I dare you to explain why :) */
apply
(
o
->
obj
,
"set_id"
,
1
);
pop_stack
();
...
...
@@ -1032,6 +1040,7 @@ static void pipe_write_output_callback(INT32 args)
if
(
sp
[
-
args
].
u
.
object
->
prog
!=
output_program
)
error
(
"Illegal argument to pipe->write_output_callback
\n
"
);
debug_malloc_touch
(
sp
[
-
args
].
u
.
object
);
output_try_write_some
(
sp
[
-
args
].
u
.
object
);
pop_n_elems
(
args
-
1
);
}
...
...
@@ -1133,6 +1142,9 @@ void close_and_free_everything(struct object *thisobj,struct pipe *p)
struct
input
*
i
;
struct
output
*
o
;
struct
object
*
obj
;
debug_malloc_touch
(
thisobj
);
debug_malloc_touch
(
p
);
if
(
p
->
done
){
return
;
...
...
@@ -1195,6 +1207,8 @@ void close_and_free_everything(struct object *thisobj,struct pipe *p)
static
void
init_pipe_struct
(
struct
object
*
o
)
{
debug_malloc_touch
(
o
);
THIS
->
firstbuffer
=
THIS
->
lastbuffer
=
NULL
;
THIS
->
firstinput
=
THIS
->
lastinput
=
NULL
;
THIS
->
firstoutput
=
NULL
;
...
...
@@ -1220,7 +1234,9 @@ static void exit_output_struct(struct object *obj)
{
struct
output
*
o
;
debug_malloc_touch
(
obj
);
o
=
(
struct
output
*
)(
Pike_fp
->
current_storage
);
if
(
o
->
obj
)
{
if
(
o
->
obj
->
prog
)
...
...
@@ -1249,6 +1265,7 @@ static void exit_output_struct(struct object *obj)
static
void
init_output_struct
(
struct
object
*
ob
)
{
struct
output
*
o
;
debug_malloc_touch
(
ob
);
o
=
(
struct
output
*
)(
Pike_fp
->
current_storage
);
o
->
obj
=
0
;
}
...
...
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