/* Prepare device struct */
priv->local_bind_sd = -1;
- priv->device = os_malloc(sizeof(struct sockaddr_ll));
+ priv->device = malloc(sizeof(struct sockaddr_ll));
if (priv->device == NULL)
return -ENOMEM;
device = priv->device;
/* Prepare device struct */
priv->local_bind_sd = -1;
priv->local_bind_udp_port = 0;
- priv->device = os_malloc(sizeof(struct sockaddr_in));
+ priv->device = malloc(sizeof(struct sockaddr_in));
if (priv->device == NULL)
return -ENOMEM;
device = priv->device;
void sandbox_eth_raw_os_stop(struct eth_sandbox_raw_priv *priv)
{
- os_free(priv->device);
+ free(priv->device);
priv->device = NULL;
close(priv->sd);
priv->sd = -1;
printf("Cannot seek to start of file '%s'\n", fname);
goto err;
}
- *bufp = os_malloc(size);
+ *bufp = malloc(size);
if (!*bufp) {
printf("Not enough memory to read file '%s'\n", fname);
ret = -ENOMEM;
state->argv = argv;
/* dynamically construct the arguments to the system getopt_long */
- short_opts = os_malloc(sizeof(*short_opts) * num_options * 2 + 1);
- long_opts = os_malloc(sizeof(*long_opts) * num_options);
+ short_opts = malloc(sizeof(*short_opts) * num_options * 2 + 1);
+ long_opts = malloc(sizeof(*long_opts) * num_options);
if (!short_opts || !long_opts)
return 1;
while (node) {
next = node->next;
- os_free(node);
+ free(node);
node = next;
}
}
/* Create a buffer upfront, with typically sufficient size */
dirlen = strlen(dirname) + 2;
len = dirlen + 256;
- fname = os_malloc(len);
+ fname = malloc(len);
if (!fname) {
ret = -ENOMEM;
goto done;
ret = errno;
break;
}
- next = os_malloc(sizeof(*node) + strlen(entry->d_name) + 1);
+ next = malloc(sizeof(*node) + strlen(entry->d_name) + 1);
if (!next) {
os_dirent_free(head);
ret = -ENOMEM;
if (dirlen + strlen(entry->d_name) > len) {
len = dirlen + strlen(entry->d_name);
old_fname = fname;
- fname = os_realloc(fname, len);
+ fname = realloc(fname, len);
if (!fname) {
- os_free(old_fname);
- os_free(next);
+ free(old_fname);
+ free(next);
os_dirent_free(head);
ret = -ENOMEM;
goto done;
done:
closedir(dir);
- os_free(fname);
+ free(fname);
return ret;
}
for (argc = 0; (*argvp)[argc]; argc++)
;
- argv = os_malloc((argc + count + 1) * sizeof(char *));
+ argv = malloc((argc + count + 1) * sizeof(char *));
if (!argv) {
printf("Out of memory for %d argv\n", count);
return -ENOMEM;
os_exit(2);
err = execv(fname, argv);
- os_free(argv);
+ free(argv);
if (err) {
perror("Unable to run image");
printf("Image filename '%s'\n", fname);