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
196a8086
Commit
196a8086
authored
Sep 28, 2015
by
Christian Brauner
Committed by
Stéphane Graber
Sep 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Free allocated memory on failure (v2)
Signed-off-by:
Christian Brauner
<
christianvanbrauner@gmail.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
2b54359b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
bdev.c
src/lxc/bdev.c
+4
-1
No files found.
src/lxc/bdev.c
View file @
196a8086
...
@@ -2461,12 +2461,15 @@ static int overlayfs_clonepaths(struct bdev *orig, struct bdev *new, const char
...
@@ -2461,12 +2461,15 @@ static int overlayfs_clonepaths(struct bdev *orig, struct bdev *new, const char
// and needs to be on the same filesystem as upperdir,
// and needs to be on the same filesystem as upperdir,
// so it's OK for it to be empty.
// so it's OK for it to be empty.
work
=
malloc
(
lastslashidx
+
7
);
work
=
malloc
(
lastslashidx
+
7
);
if
(
!
work
)
if
(
!
work
)
{
free
(
delta
);
return
-
1
;
return
-
1
;
}
strncpy
(
work
,
new
->
dest
,
lastslashidx
+
1
);
strncpy
(
work
,
new
->
dest
,
lastslashidx
+
1
);
strcpy
(
work
+
lastslashidx
,
"olwork"
);
strcpy
(
work
+
lastslashidx
,
"olwork"
);
if
(
mkdir
(
work
,
0755
)
<
0
)
{
if
(
mkdir
(
work
,
0755
)
<
0
)
{
SYSERROR
(
"error: mkdir %s"
,
work
);
SYSERROR
(
"error: mkdir %s"
,
work
);
free
(
delta
);
free
(
work
);
free
(
work
);
return
-
1
;
return
-
1
;
}
}
...
...
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