From: Ben Pfaff Date: Thu, 27 Nov 2008 00:07:56 +0000 (-0800) Subject: Make dpif_close() accept a null pointer. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12333d665075b5a1042bac3916ed0df00e549266;p=openvswitch Make dpif_close() accept a null pointer. It's customary for destructor functions to accept and ignore null pointers. This commit does not fix any known bug. --- diff --git a/lib/dpif.c b/lib/dpif.c index 5739e18a..6407490d 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -103,7 +103,9 @@ dpif_open(int dp_idx, bool subscribe, struct dpif *dp) void dpif_close(struct dpif *dp) { - nl_sock_destroy(dp->sock); + if (dp) { + nl_sock_destroy(dp->sock); + } } static const struct nl_policy openflow_policy[] = {