Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
9688b688
Commit
9688b688
authored
Aug 10, 2019
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leaks in error-handling paths in configuration parser.
parent
4d8a8315
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
configuration.c
configuration.c
+5
-0
hmac.c
hmac.c
+1
-0
No files found.
configuration.c
View file @
9688b688
...
@@ -1214,23 +1214,28 @@ parse_config_line(int c, gnc_t gnc, void *closure,
...
@@ -1214,23 +1214,28 @@ parse_config_line(int c, gnc_t gnc, void *closure,
struct
key
*
key
=
NULL
;
struct
key
*
key
=
NULL
;
c
=
parse_key
(
c
,
gnc
,
closure
,
&
key
);
c
=
parse_key
(
c
,
gnc
,
closure
,
&
key
);
if
(
c
<
-
1
||
key
==
NULL
||
key
->
id
==
NULL
)
{
if
(
c
<
-
1
||
key
==
NULL
||
key
->
id
==
NULL
)
{
if
(
key
!=
NULL
)
free
(
key
->
value
);
free
(
key
);
free
(
key
);
goto
fail
;
goto
fail
;
}
}
switch
(
key
->
type
)
{
switch
(
key
->
type
)
{
case
AUTH_TYPE_SHA256
:
case
AUTH_TYPE_SHA256
:
if
(
key
->
len
!=
32
)
{
if
(
key
->
len
!=
32
)
{
free
(
key
->
value
);
free
(
key
);
free
(
key
);
goto
fail
;
goto
fail
;
}
}
break
;
break
;
case
AUTH_TYPE_BLAKE2S
:
case
AUTH_TYPE_BLAKE2S
:
if
(
key
->
len
!=
16
)
{
if
(
key
->
len
!=
16
)
{
free
(
key
->
value
);
free
(
key
);
free
(
key
);
goto
fail
;
goto
fail
;
}
}
break
;
break
;
default:
default:
free
(
key
->
value
);
free
(
key
);
free
(
key
);
goto
fail
;
goto
fail
;
}
}
...
...
hmac.c
View file @
9688b688
...
@@ -24,6 +24,7 @@ THE SOFTWARE.
...
@@ -24,6 +24,7 @@ THE SOFTWARE.
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#include <assert.h>
#include <assert.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include "rfc6234/sha.h"
#include "rfc6234/sha.h"
...
...
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