mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 18:55:09 +03:00
network: fix memleak
If init() is failed, the allocated memory was leaked.
This commit is contained in:
parent
c1495f8e9d
commit
58e6c62191
@ -39,7 +39,7 @@ const QDiscVTable * const qdisc_vtable[_QDISC_KIND_MAX] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int qdisc_new(QDiscKind kind, QDisc **ret) {
|
static int qdisc_new(QDiscKind kind, QDisc **ret) {
|
||||||
QDisc *qdisc;
|
_cleanup_(qdisc_freep) QDisc *qdisc = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (kind == _QDISC_KIND_INVALID) {
|
if (kind == _QDISC_KIND_INVALID) {
|
||||||
|
@ -22,7 +22,7 @@ const TClassVTable * const tclass_vtable[_TCLASS_KIND_MAX] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int tclass_new(TClassKind kind, TClass **ret) {
|
static int tclass_new(TClassKind kind, TClass **ret) {
|
||||||
TClass *tclass;
|
_cleanup_(tclass_freep) TClass *tclass = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
tclass = malloc0(tclass_vtable[kind]->object_size);
|
tclass = malloc0(tclass_vtable[kind]->object_size);
|
||||||
|
Loading…
Reference in New Issue
Block a user