Fix potential pfree of NULL pointer
If strlen(addr) is zero then based on how get_dest_address() works
addr will be NULL, and pfree() on NULL is not permitted. Also, we
know that addr will either be a non-empty string or NULL, so we can
just as well test for addr being NULL and avoid a strlen() call.
Fix by only pfreeing when addr is set. (this is in an elog(ERROR..)
context so freeing isn't terribly interesting but it also doesn't
hurt so I'm keeping the current codepath.)
Reviewed-by: NFrancisco Guerrero <aguerrero@pivotal.io>
Showing
想要评论请 注册 或 登录