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
32068050
Unverified
Commit
32068050
authored
Feb 05, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rbd: remove stack allocations
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
9371d3f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
rbd.c
src/lxc/storage/rbd.c
+3
-2
No files found.
src/lxc/storage/rbd.c
View file @
32068050
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "config.h"
#include "config.h"
#include "log.h"
#include "log.h"
#include "memory_utils.h"
#include "storage.h"
#include "storage.h"
#include "storage_utils.h"
#include "storage_utils.h"
#include "utils.h"
#include "utils.h"
...
@@ -195,9 +196,9 @@ int rbd_create(struct lxc_storage *bdev, const char *dest, const char *n,
...
@@ -195,9 +196,9 @@ int rbd_create(struct lxc_storage *bdev, const char *dest, const char *n,
int
rbd_destroy
(
struct
lxc_storage
*
orig
)
int
rbd_destroy
(
struct
lxc_storage
*
orig
)
{
{
__do_free
char
*
rbdfullname
=
NULL
;
int
ret
;
int
ret
;
const
char
*
src
;
const
char
*
src
;
char
*
rbdfullname
;
char
cmd_output
[
PATH_MAX
];
char
cmd_output
[
PATH_MAX
];
struct
rbd_args
args
=
{
0
};
struct
rbd_args
args
=
{
0
};
size_t
len
;
size_t
len
;
...
@@ -215,7 +216,7 @@ int rbd_destroy(struct lxc_storage *orig)
...
@@ -215,7 +216,7 @@ int rbd_destroy(struct lxc_storage *orig)
}
}
len
=
strlen
(
src
);
len
=
strlen
(
src
);
rbdfullname
=
alloca
(
len
-
8
);
rbdfullname
=
must_realloc
(
NULL
,
len
-
8
);
(
void
)
strlcpy
(
rbdfullname
,
&
src
[
9
],
len
-
8
);
(
void
)
strlcpy
(
rbdfullname
,
&
src
[
9
],
len
-
8
);
args
.
rbd_name
=
rbdfullname
;
args
.
rbd_name
=
rbdfullname
;
...
...
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