Skip to content

Commit

Permalink
Add missing free of NetworkInstanceStatus
Browse files Browse the repository at this point in the history
From comments in #2285

Signed-off-by: eriknordmark <erik@zededa.com>
  • Loading branch information
eriknordmark committed May 3, 2023
1 parent 886b91a commit 1f426fd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/pillar/cmd/zedrouter/zedrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,14 @@ func doAppNetworkModifyUNetAppNum(
log.Error(err)
return err
}
// Did the freeAppIntfNum release any last reference?
netstatus := lookupNetworkInstanceStatus(ctx, ulStatus.Network.String())
if netstatus != nil {
if maybeNetworkInstanceDelete(ctx, netstatus) {
log.Functionf("post freeAppIntfNum(%v) for %s deleted %s",
oldNetworkID, appID, netstatus.Key())
}
}
return nil
}

Expand Down Expand Up @@ -1982,7 +1990,7 @@ func handleDelete(ctx *zedrouterContext, key string,
netstatus := lookupNetworkInstanceStatus(ctx, ulStatus.Network.String())
if netstatus != nil {
if maybeNetworkInstanceDelete(ctx, netstatus) {
log.Functionf("post appNumsOnUNetFree(%v) for %s deleted %s",
log.Functionf("post freeAppIntfNums(%v) for %s deleted %s",
status.UUIDandVersion, status.DisplayName,
netstatus.Key())
}
Expand Down

0 comments on commit 1f426fd

Please sign in to comment.