if (rp->version == 0)
{
clib_warning ("rp->version %d not %d", rp->version, SVM_VERSION);
+ munmap (rp, MMAP_PAGESIZE);
return (0);
}
/* Remap now that the region has been placed */
if (!(statb.st_mode & S_IFREG) || (statb.st_size < sizeof (*hp)))
{
vlib_cli_output (vm, "File not plausible: %s\n", filename);
+ close(fd);
return;
}
{
vlib_cli_output (vm, "Range (%d, %d) outside file range (0, %d)\n",
first_index, last_index, nitems - 1);
+ munmap (hp, file_size);
return;
}
if (hp->wrapped)
}
msg_id = ntohs (msg_id);
- fseek (fp, -2, SEEK_CUR);
+ if (fseek (fp, -2, SEEK_CUR) < 0)
+ {
+ vlib_cli_output (vm, "fseek failed, %s", strerror(errno));
+ fclose(fp);
+ return;
+ }
/* Mild sanity check */
if (msg_id >= vec_len (am->msg_handlers))
if (rv < 0)
{
clib_unix_warning ("FIONBIO");
+ close(sockfd);
return ~0;
}
rv = listen (sockfd, 5);
if (rv < 0)
{
+ close(sockfd);
return clib_error_return_unix (0, "listen");
}
q = hash_get_mem (cm->parse_rule_index_by_name, sub_name);
if (!q)
- clib_error ("reference to unknown rule `%%%v' in path `%v'",
- sub_name, c->path);
+ {
+ clib_error ("reference to unknown rule `%%%v' in path `%v'",
+ sub_name, c->path);
+ return;
+ }
hash_set_mem (p->sub_rule_index_by_name, sub_name,
vec_len (p->sub_rules));