mirror of
https://github.com/systemd/systemd.git
synced 2025-03-06 00:58:29 +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) {
|
||||
QDisc *qdisc;
|
||||
_cleanup_(qdisc_freep) QDisc *qdisc = NULL;
|
||||
int r;
|
||||
|
||||
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) {
|
||||
TClass *tclass;
|
||||
_cleanup_(tclass_freep) TClass *tclass = NULL;
|
||||
int r;
|
||||
|
||||
tclass = malloc0(tclass_vtable[kind]->object_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user