diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-10-26 19:04:41 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-10-26 19:50:55 +0100 |
commit | db2b52ee8477a0223114aeadc15c3bfe8c2ee1fd (patch) | |
tree | 141b843231f7939badfbb8a19ed821a5229c44ad /src | |
parent | 67354b1b4ee412a8e878a53607fcd65f2b344948 (diff) |
sim: More talloc return NULL checking
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sim/core.c b/src/sim/core.c index dba378b6..890df667 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -37,6 +37,8 @@ struct osim_decoded_data *osim_file_decode(struct osim_file *file, return NULL; dd = talloc_zero(file, struct osim_decoded_data); + if (!dd) + return NULL; dd->file = file; if (file->desc->ops.parse(dd, file->desc, len, data) < 0) { @@ -121,6 +123,8 @@ struct osim_file_desc *alloc_df(void *ctx, uint16_t fid, const char *name) struct osim_file_desc *mf; mf = talloc_zero(ctx, struct osim_file_desc); + if (!mf) + return NULL; mf->type = TYPE_DF; mf->fid = fid; mf->short_name = name; @@ -137,6 +141,8 @@ add_df_with_ef(struct osim_file_desc *parent, struct osim_file_desc *df; df = alloc_df(parent, fid, name); + if (!df) + return NULL; df->parent = parent; llist_add_tail(&df->list, &parent->child_list); add_filedesc(df, in, num); @@ -153,6 +159,8 @@ add_adf_with_ef(struct osim_file_desc *parent, struct osim_file_desc *df; df = alloc_df(parent, 0xffff, name); + if (!df) + return NULL; df->type = TYPE_ADF; df->df_name = adf_name; df->df_name_len = adf_name_len; |