1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

removed last direct calls to malloc()

This commit is contained in:
Steffen Vogel 2015-03-21 11:54:14 +01:00
parent a9795eda7c
commit d25ad21d86
2 changed files with 2 additions and 6 deletions

View file

@ -273,11 +273,7 @@ int config_parse_opal(config_setting_t *cfg, struct node *n)
return -1;
}
struct opal *o = (struct opal *) malloc(sizeof(struct opal));
if (!o)
error("Failed to allocate memory for opal settings");
memset(o, 0, sizeof(struct opal));
struct opal *o = (struct opal *) alloc(sizeof(struct opal));
config_setting_lookup_int(cfg, "send_id", &o->send_id);
config_setting_lookup_int(cfg, "recv_id", &o->recv_id);

View file

@ -127,7 +127,7 @@ int hook_fir(struct msg *m, struct path *p)
/* Create thread local storage for circular history buffer */
if (!history) {
history = malloc(len * sizeof(float));
history = alloc(len * sizeof(float));
pthread_key_create(&pkey, free);
pthread_setspecific(pkey, history);