Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
1eafd26f
Commit
1eafd26f
authored
Sep 04, 2019
by
Mark Andrews
Browse files
address NULL pointer dereferences
(cherry picked from commit
2de94dd4
)
parent
573f88e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
contrib/dlz/modules/mysqldyn/dlz_mysqldyn_mod.c
View file @
1eafd26f
...
...
@@ -1297,9 +1297,21 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
* Create new transaction
*/
newtx
=
(
mysql_transaction_t
*
)
malloc
(
sizeof
(
mysql_transaction_t
));
calloc
(
1
,
sizeof
(
mysql_transaction_t
));
if
(
newtx
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup
;
}
newtx
->
zone
=
strdup
(
zone
);
if
(
newtx
->
zone
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup
;
}
newtx
->
zone_id
=
strdup
(
zone_id
);
if
(
newtx
->
zone_id
==
NULL
)
{
result
=
ISC_R_NOMEMORY
;
goto
cleanup
;
}
newtx
->
dbi
=
get_dbi
(
state
);
newtx
->
next
=
NULL
;
...
...
@@ -1329,9 +1341,15 @@ dlz_newversion(const char *zone, void *dbdata, void **versionp) {
*
versionp
=
(
void
*
)
newtx
;
}
else
{
dlz_mutex_unlock
(
&
state
->
tx_mutex
);
free
(
newtx
->
zone
);
free
(
newtx
->
zone_id
);
free
(
newtx
);
if
(
newtx
!=
NULL
)
{
if
(
newtx
->
zone
!=
NULL
)
{
free
(
newtx
->
zone
);
}
if
(
newtx
->
zone
!=
NULL
)
{
free
(
newtx
->
zone_id
);
}
free
(
newtx
);
}
}
return
(
result
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment