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
9529609a
Commit
9529609a
authored
Nov 14, 2013
by
S.Çağlar Onur
Committed by
Serge Hallyn
Nov 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory leaks reported by cppcheck in src/lxc/bdev.c
Signed-off-by:
S.Çağlar Onur
<
caglar@10ur.org
>
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
parent
dceb6c80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
bdev.c
src/lxc/bdev.c
+5
-1
No files found.
src/lxc/bdev.c
View file @
9529609a
...
@@ -962,8 +962,10 @@ static int lvm_snapshot(const char *orig, const char *path, unsigned long size)
...
@@ -962,8 +962,10 @@ static int lvm_snapshot(const char *orig, const char *path, unsigned long size)
// check if the original lv is backed by a thin pool, in which case we
// check if the original lv is backed by a thin pool, in which case we
// cannot specify a size that's different from the original size.
// cannot specify a size that's different from the original size.
ret
=
lvm_is_thin_volume
(
orig
);
ret
=
lvm_is_thin_volume
(
orig
);
if
(
ret
==
-
1
)
if
(
ret
==
-
1
)
{
free
(
pathdup
);
return
-
1
;
return
-
1
;
}
if
(
!
ret
)
{
if
(
!
ret
)
{
ret
=
execlp
(
"lvcreate"
,
"lvcreate"
,
"-s"
,
"-L"
,
sz
,
"-n"
,
lv
,
orig
,
(
char
*
)
NULL
);
ret
=
execlp
(
"lvcreate"
,
"lvcreate"
,
"-s"
,
"-L"
,
sz
,
"-n"
,
lv
,
orig
,
(
char
*
)
NULL
);
...
@@ -1282,6 +1284,7 @@ static int btrfs_subvolume_create(const char *path)
...
@@ -1282,6 +1284,7 @@ static int btrfs_subvolume_create(const char *path)
p
=
strrchr
(
newfull
,
'/'
);
p
=
strrchr
(
newfull
,
'/'
);
if
(
!
p
)
{
if
(
!
p
)
{
ERROR
(
"bad path: %s"
,
path
);
ERROR
(
"bad path: %s"
,
path
);
free
(
newfull
);
return
-
1
;
return
-
1
;
}
}
*
p
=
'\0'
;
*
p
=
'\0'
;
...
@@ -1418,6 +1421,7 @@ static int btrfs_destroy(struct bdev *orig)
...
@@ -1418,6 +1421,7 @@ static int btrfs_destroy(struct bdev *orig)
p
=
strrchr
(
newfull
,
'/'
);
p
=
strrchr
(
newfull
,
'/'
);
if
(
!
p
)
{
if
(
!
p
)
{
ERROR
(
"bad path: %s"
,
path
);
ERROR
(
"bad path: %s"
,
path
);
free
(
newfull
);
return
-
1
;
return
-
1
;
}
}
*
p
=
'\0'
;
*
p
=
'\0'
;
...
...
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