Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
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
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
a8f7d7fa
Commit
a8f7d7fa
authored
Mar 16, 2022
by
Filip Matusiak
Browse files
Options
Downloads
Patches
Plain Diff
fix meamleaks and cores in exit path
parent
ec686a5e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!101
fix meamleaks and cores in exit path
Pipeline
#46144
passed
Mar 18, 2022
Stage: static_code_analysis
Stage: compile_test
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cntlr.c
+8
-45
8 additions, 45 deletions
src/cntlr.c
with
8 additions
and
45 deletions
src/cntlr.c
+
8
−
45
View file @
a8f7d7fa
...
@@ -50,33 +50,6 @@
...
@@ -50,33 +50,6 @@
extern
bool
waitext
;
extern
bool
waitext
;
void
stop_cntlr
(
struct
controller
*
c
)
{
if
(
!
c
)
{
warn
(
"%s: (cntlr = NULL)
\n
"
,
__func__
);
exit
(
0
);
}
ubus_unregister_event_handler
(
c
->
ubus_ctx
,
&
c
->
evh
);
cntlr_remove_object
(
c
);
cmdu_ackq_free
(
&
c
->
cmdu_ack_q
);
uloop_done
();
cntlr_config_clean
(
&
c
->
cfg
);
ubus_free
(
c
->
ubus_ctx
);
free
(
c
);
}
static
void
cntlr_terminate
(
struct
controller
*
c
)
{
dbg
(
"%s: called.
\n
"
,
__func__
);
stop_cntlr
(
c
);
//exit_alloctrace();
stop_logging
();
//unlink(pidfile);
exit
(
0
);
}
/* find interface by macaddress - no radio argument */
/* find interface by macaddress - no radio argument */
struct
netif_iface
*
find_interface_by_mac_nor
(
struct
controller
*
c
,
struct
netif_iface
*
find_interface_by_mac_nor
(
struct
controller
*
c
,
uint8_t
*
hwaddr
)
uint8_t
*
hwaddr
)
...
@@ -1828,18 +1801,6 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
...
@@ -1828,18 +1801,6 @@ static void cntlr_signal_periodic_run(struct uloop_timeout *t)
sigpending
(
&
waiting_mask
);
sigpending
(
&
waiting_mask
);
if
(
sigismember
(
&
waiting_mask
,
SIGINT
))
{
dbg
(
"|%s:%d| Received SIGINT, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGINT
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGTERM
))
{
dbg
(
"|%s:%d| Received SIGSTP, terminating
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGTERM
,
SIG_IGN
);
cntlr_terminate
(
c
);
}
if
(
sigismember
(
&
waiting_mask
,
SIGHUP
))
{
if
(
sigismember
(
&
waiting_mask
,
SIGHUP
))
{
dbg
(
"|%s:%d| Received SIGHUP, reload config
\n
"
,
__func__
,
__LINE__
);
dbg
(
"|%s:%d| Received SIGHUP, reload config
\n
"
,
__func__
,
__LINE__
);
signal
(
SIGHUP
,
SIG_IGN
);
signal
(
SIGHUP
,
SIG_IGN
);
...
@@ -2408,8 +2369,6 @@ int start_controller(void)
...
@@ -2408,8 +2369,6 @@ int start_controller(void)
sigset_t
base_mask
;
sigset_t
base_mask
;
sigemptyset
(
&
base_mask
);
sigemptyset
(
&
base_mask
);
sigaddset
(
&
base_mask
,
SIGINT
);
sigaddset
(
&
base_mask
,
SIGTERM
);
sigaddset
(
&
base_mask
,
SIGHUP
);
sigaddset
(
&
base_mask
,
SIGHUP
);
sigprocmask
(
SIG_SETMASK
,
&
base_mask
,
NULL
);
sigprocmask
(
SIG_SETMASK
,
&
base_mask
,
NULL
);
...
@@ -2482,13 +2441,17 @@ int start_controller(void)
...
@@ -2482,13 +2441,17 @@ int start_controller(void)
controller_subscribe_for_cmdus
(
c
);
controller_subscribe_for_cmdus
(
c
);
uloop_run
();
uloop_run
();
out_exit:
out_exit:
/* ubus_unregister_event_handler(ctx, ev); */
ubus_unregister_event_handler
(
ctx
,
&
c
->
evh
);
/* cntlr_remove_object(ctx); */
cntlr_remove_object
(
c
);
cmdu_ackq_free
(
&
c
->
cmdu_ack_q
);
cntlr_config_clean
(
&
c
->
cfg
);
ubus_free
(
c
->
ubus_ctx
);
uloop_done
();
uloop_done
();
cntlr_terminate
(
c
);
free
(
c
);
stop_logging
();
return
0
;
return
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
sign in
to comment