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:
Jukka Rissanen 2017-06-02 09:09:30 +03:00
commit bd7d1bda20

View file

@ -455,7 +455,9 @@ static void recv_cb(struct net_context *net_ctx, struct net_pkt *pkt,
} }
out: out:
net_pkt_unref(pkt); if (pkt) {
net_pkt_unref(pkt);
}
} }
static int get_local_addr(struct http_client_ctx *ctx) static int get_local_addr(struct http_client_ctx *ctx)