fl = flist_scan(argv[1]);
if (fl == NULL)
return 0;
- if (!flist_parse(fld, fl, iocur_top->data, 0)) {
- flist_free(fl);
- return 0;
- }
+ if (!flist_parse(fld, fl, iocur_top->data, 0))
+ goto out;
+
flist_print(fl);
for (tfl = fl; tfl->child != NULL; tfl = tfl->child) {
if ((tfl->flags & FL_OKLOW) && tfl->low < tfl->high) {
dbprintf(_("array not allowed for addr command\n"));
- flist_free(fl);
- return 0;
+ goto out;
}
}
fld = tfl->fld;
next = inode_next_type();
if (next == TYP_NONE) {
dbprintf(_("no next type for field %s\n"), fld->name);
- return 0;
+ goto out;
}
fa = &ftattrtab[fld->ftyp];
ASSERT(fa->ftyp == fld->ftyp);
if (adf == NULL) {
dbprintf(_("no addr function for field %s (type %s)\n"),
fld->name, fa->name);
- return 0;
+ goto out;
}
(*adf)(iocur_top->data, tfl->offset, next);
+out:
flist_free(fl);
return 0;
}
}
if (blocks == 0) {
dbprintf(_("blocktrash: no matching blocks\n"));
- return 0;
+ goto out;
}
if (!sopt)
dbprintf(_("blocktrash: seed %u\n"), seed);
}
}
}
+out:
xfree(lentab);
return 0;
}
break;
default:
dbprintf(_("bad option -%c for ncheck command\n"), c);
+ xfree(ilist);
return 0;
}
}
memcpy(hold_region, base, shift);
memcpy(base, base+shift, len-shift);
memcpy(base+(len-shift), hold_region, shift);
+ free(hold_region);
}
/* ARGSUSED */
memcpy(hold_region, base+(len-shift), shift);
memmove(base+shift, base, len-shift);
memcpy(base, hold_region, shift);
+ free(hold_region);
}
/* ARGSUSED */
if (!bstatbuf || !parentbuf) {
fprintf(stderr, _("unable to allocate buffers: %s\n"),
strerror(errno));
+ free(bstatbuf);
+ free(parentbuf);
return 1;
}
setup_proto(
char *fname)
{
- char *buf;
+ char *buf = NULL;
static char dflt[] = "d--755 0 0 $";
int fd;
long size;
out_fail:
close(fd);
+ free(buf);
exit(1);
}