Fixes for issues raised by Coverity (VPP-972)

Change-Id: I4b1f27b95d67d48b7a13750ff8754c344ed7afa7
Signed-off-by: Chris Luke <chrisy@flirble.org>
This commit is contained in:
Chris Luke
2017-09-05 11:59:55 -04:00
committed by Dave Wallace
parent 704018cf11
commit 2951d901a5
3 changed files with 4 additions and 6 deletions

View File

@ -186,10 +186,10 @@ api_memif_create (vat_main_t * vam)
strncpy ((char *) mp->socket_filename, (char *) socket_filename, 127);
vec_free (socket_filename);
}
if (socket_filename != 0)
if (secret != 0)
{
strncpy ((char *) mp->secret, (char *) secret, 16);
vec_free (socket_filename);
vec_free (secret);
}
memcpy (mp->hw_addr, hw_addr, 6);
mp->rx_queues = rx_queues;

View File

@ -68,9 +68,6 @@ vl_api_mpls_table_add_del_t_handler (vl_api_mpls_table_add_del_t * mp)
vnm = vnet_get_main ();
vnm->api_errno = 0;
rv = (rv == 0) ? vnm->api_errno : rv;
REPLY_MACRO (VL_API_MPLS_TABLE_ADD_DEL_REPLY);
}

View File

@ -509,10 +509,11 @@ u8 *BV (format_bihash_lru) (u8 * s, va_list * args)
for (i = 0; i < BIHASH_KVP_CACHE_SIZE; i++)
s = format (s, "[%d] ", ((cache_lru >> (3 * i)) & 7));
return (s);
#else
return format (s, "cache not configured");
#endif
return (s);
}
void