Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
612e48a3
Unverified
Commit
612e48a3
authored
May 13, 2019
by
Christian Brauner
Committed by
GitHub
May 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2999 from rikardfalkeborn/fix-realloc-memleak-proctitle
initutils: Fix memleak on realloc failure
parents
7d4188ce
e1d43053
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
initutils.c
src/lxc/initutils.c
+5
-3
No files found.
src/lxc/initutils.c
View file @
612e48a3
...
@@ -242,7 +242,7 @@ int setproctitle(char *title)
...
@@ -242,7 +242,7 @@ int setproctitle(char *title)
{
{
__do_fclose
FILE
*
f
=
NULL
;
__do_fclose
FILE
*
f
=
NULL
;
int
i
,
fd
,
len
;
int
i
,
fd
,
len
;
char
*
buf_ptr
;
char
*
buf_ptr
,
*
tmp_proctitle
;
char
buf
[
LXC_LINELEN
];
char
buf
[
LXC_LINELEN
];
int
ret
=
0
;
int
ret
=
0
;
ssize_t
bytes_read
=
0
;
ssize_t
bytes_read
=
0
;
...
@@ -305,10 +305,12 @@ int setproctitle(char *title)
...
@@ -305,10 +305,12 @@ int setproctitle(char *title)
* want to have room for it. */
* want to have room for it. */
len
=
strlen
(
title
)
+
1
;
len
=
strlen
(
title
)
+
1
;
proctitle
=
realloc
(
proctitle
,
len
);
tmp_
proctitle
=
realloc
(
proctitle
,
len
);
if
(
!
proctitle
)
if
(
!
tmp_
proctitle
)
return
-
1
;
return
-
1
;
proctitle
=
tmp_proctitle
;
arg_start
=
(
unsigned
long
)
proctitle
;
arg_start
=
(
unsigned
long
)
proctitle
;
arg_end
=
arg_start
+
len
;
arg_end
=
arg_start
+
len
;
...
...
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