Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Eric Vidal
66
Commits
bbcc4f0b
Commit
bbcc4f0b
authored
2 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
fix memory leak
parent
b1f8c005
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/service/service_graph_collect.c
+23
-6
23 additions, 6 deletions
src/lib66/service/service_graph_collect.c
with
23 additions
and
6 deletions
src/lib66/service/service_graph_collect.c
+
23
−
6
View file @
bbcc4f0b
...
...
@@ -51,6 +51,9 @@ void service_graph_collect(graph_t *g, char const *alist, size_t alen, resolve_s
if
(
service_resolve_array_search
(
ares
,
(
*
areslen
),
name
)
<
0
)
{
resolve_service_t
res
=
RESOLVE_SERVICE_ZERO
;
/** need to make a copy of the resolve due of the freed
* of the wres struct at the end of the process */
resolve_service_t
cp
=
RESOLVE_SERVICE_ZERO
;
wres
=
resolve_set_struct
(
DATA_SERVICE
,
&
res
)
;
if
(
FLAGS_ISSET
(
flag
,
STATE_FLAGS_TOINIT
))
...
...
@@ -64,12 +67,26 @@ void service_graph_collect(graph_t *g, char const *alist, size_t alen, resolve_s
if
(
!
state_read
(
&
ste
,
res
.
sa
.
s
+
res
.
path
.
home
,
name
))
log_dieu
(
LOG_EXIT_SYS
,
"read state file of: "
,
name
,
" -- please make a bug report"
)
;
if
(
service_is
(
&
ste
,
STATE_FLAGS_ISSUPERVISED
))
ares
[(
*
areslen
)
++
]
=
res
;
else
if
(
service_is
(
&
ste
,
STATE_FLAGS_ISSUPERVISED
))
{
if
(
!
service_resolve_copy
(
&
cp
,
&
res
))
log_dieu
(
LOG_EXIT_SYS
,
"copy resolve file of: "
,
name
,
" -- please make a bug report"
)
;
ares
[(
*
areslen
)
++
]
=
cp
;
}
else
{
resolve_free
(
wres
)
;
continue
;
}
else
ares
[(
*
areslen
)
++
]
=
res
;
}
}
else
{
if
(
!
service_resolve_copy
(
&
cp
,
&
res
))
log_dieu
(
LOG_EXIT_SYS
,
"copy resolve file of: "
,
name
,
" -- please make a bug report"
)
;
ares
[(
*
areslen
)
++
]
=
cp
;
}
if
(
FLAGS_ISSET
(
flag
,
STATE_FLAGS_TOPROPAGATE
))
{
...
...
@@ -88,9 +105,9 @@ void service_graph_collect(graph_t *g, char const *alist, size_t alen, resolve_s
service_graph_collect
(
g
,
sa
.
s
,
sa
.
len
,
ares
,
areslen
,
info
,
flag
)
;
}
}
resolve_free
(
wres
)
;
}
}
free
(
wres
)
;
stralloc_free
(
&
sa
)
;
}
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