netlink-socket: Fix possiblity of nl_transact dereferencing null pointer
Many nl_transact callers and its wrapper tc_transact pass NULL for replyp
which is being accessed in error flow without being checked if null or not.
@@ -1698,7 +1698,9 @@ nl_transact(int protocol, const struct ofpbuf *request,
error = nl_pool_alloc(protocol, &sock);
if (error) {
+ if (replyp) {
*replyp = NULL;
+ }
return error;
}
