libpfctl: fix Coverity issues
authorKristof Provost <kp@FreeBSD.org>
Mon, 23 Oct 2023 11:46:11 +0000 (13:46 +0200)
committerKristof Provost <kp@FreeBSD.org>
Tue, 24 Oct 2023 07:50:47 +0000 (09:50 +0200)
commit4abc3b482e0d246cd3518622223795c8de102130
treee6a43574f5356644c766f5e649d0171a59bfa8a4
parent2cffb52514b070e716e700c7f58fdb8cd9b05335
libpfctl: fix Coverity issues

 - handle snl_finalize_msg() returning NULL
 - insert the correct data into the states list
 - add missing nvlist_destroy()
 - incorrect order for array bounds

Coverity: 1522929, 1522925, 1522923, 1522921, 1522780, 1522770, 1522764, 1487785, 1471250
Reviewed by: emaste
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D42330
lib/libpfctl/libpfctl.c