Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
65985384
Commit
65985384
authored
Feb 15, 2015
by
Chen Wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leak
parent
79410e2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
src/dnsmasq.c
src/dnsmasq.c
+2
-0
src/option.c
src/option.c
+18
-2
No files found.
src/dnsmasq.c
View file @
65985384
...
@@ -627,6 +627,8 @@ int main (int argc, char **argv)
...
@@ -627,6 +627,8 @@ int main (int argc, char **argv)
}
}
#ifdef HAVE_LINUX_NETWORK
#ifdef HAVE_LINUX_NETWORK
free
(
hdr
);
free
(
data
);
if
(
option_bool
(
OPT_DEBUG
))
if
(
option_bool
(
OPT_DEBUG
))
prctl
(
PR_SET_DUMPABLE
,
1
,
0
,
0
,
0
);
prctl
(
PR_SET_DUMPABLE
,
1
,
0
,
0
,
0
);
#endif
#endif
...
...
src/option.c
View file @
65985384
...
@@ -2354,6 +2354,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2354,6 +2354,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
np
=
add_or_lookup_domain
(
daemon
->
dh_special_domains
,
domain
);
np
=
add_or_lookup_domain
(
daemon
->
dh_special_domains
,
domain
);
}
}
free
(
domain
);
// domain unrecognizable
// domain unrecognizable
if
(
np
==
NULL
)
if
(
np
==
NULL
)
continue
;
continue
;
...
@@ -2489,6 +2490,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2489,6 +2490,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
if
(
domain
!=
NULL
)
if
(
domain
!=
NULL
)
np
=
add_or_lookup_domain
(
daemon
->
dh_ipsets
,
domain
);
np
=
add_or_lookup_domain
(
daemon
->
dh_ipsets
,
domain
);
free
(
domain
);
arg
=
end
;
arg
=
end
;
}
}
...
@@ -2517,12 +2519,18 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -2517,12 +2519,18 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
}
}
while
(
end
);
while
(
end
);
struct
ipsets_names
*
old_obj
;
*
sets_pos
=
NULL
;
*
sets_pos
=
NULL
;
if
(
np
!=
NULL
)
if
(
np
!=
NULL
)
{
{
obj
=
opt_malloc
(
sizeof
(
struct
ipsets_names
));
obj
=
opt_malloc
(
sizeof
(
struct
ipsets_names
));
obj
->
sets
=
sets
;
obj
->
sets
=
sets
;
obj
->
count
=
sets_count
;
obj
->
count
=
sets_count
;
if
(
np
->
obj
!=
NULL
)
{
old_obj
=
(
struct
ipsets_names
*
)
np
->
obj
;
free
(
old_obj
->
sets
);
free
(
old_obj
);
}
np
->
obj
=
(
void
*
)
obj
;
np
->
obj
=
(
void
*
)
obj
;
}
}
...
@@ -4477,7 +4485,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
...
@@ -4477,7 +4485,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
{
{
char
*
buff
=
opt_malloc
(
MAXDNAME
);
char
*
buff
=
opt_malloc
(
MAXDNAME
);
int
option
,
conffile_opt
=
'7'
,
testmode
=
0
;
int
option
,
conffile_opt
=
'7'
,
testmode
=
0
;
char
*
arg
,
*
conffile
=
CONFFILE
;
char
*
arg
,
*
conffile
=
NULL
;
opterr
=
0
;
opterr
=
0
;
...
@@ -4592,7 +4600,15 @@ void read_opts(int argc, char **argv, char *compile_opts)
...
@@ -4592,7 +4600,15 @@ void read_opts(int argc, char **argv, char *compile_opts)
}
}
if
(
conffile
)
if
(
conffile
)
one_file
(
conffile
,
conffile_opt
);
{
one_file
(
conffile
,
conffile_opt
);
free
(
conffile
);
}
else
{
one_file
(
CONFFILE
,
conffile_opt
);
}
/* port might not be known when the address is parsed - fill in here */
/* port might not be known when the address is parsed - fill in here */
if
(
daemon
->
servers
)
if
(
daemon
->
servers
)
...
...
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