net: http: Avoid unnecessary net_pkt error print
In some cases the net_pkt can be null when freeing it, this will print error from net_pkt library. Avoid this by checking the value of net_pkt before calling net_pkt_unref(). Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
c9e6ef5331
commit
bd7d1bda20
1 changed files with 3 additions and 1 deletions
|
@ -455,7 +455,9 @@ static void recv_cb(struct net_context *net_ctx, struct net_pkt *pkt,
|
|||
}
|
||||
|
||||
out:
|
||||
net_pkt_unref(pkt);
|
||||
if (pkt) {
|
||||
net_pkt_unref(pkt);
|
||||
}
|
||||
}
|
||||
|
||||
static int get_local_addr(struct http_client_ctx *ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue