X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=a5341b3651daedf5e1a349f8d5b27c6d5820267b;hp=15c03ab661b1586efff4447c1de79437564dfa2f;hb=aac0ac249169a8774b30a2f3458a056ae2c80c63;hpb=3a1501e9e07a93a9b157fcce53aa070c5a0bf3d8 diff --git a/decoder.c b/decoder.c index 15c03ab..a5341b3 100644 --- a/decoder.c +++ b/decoder.c @@ -132,11 +132,7 @@ static int get_channels(const struct srd_decoder *d, const char *attr, break; } - if (!(pdch = g_try_malloc(sizeof(struct srd_channel)))) { - srd_err("Failed to g_malloc() struct srd_channel."); - ret = SRD_ERR_MALLOC; - break; - } + pdch = g_malloc(sizeof(struct srd_channel)); if ((py_dictitem_as_str(py_entry, "id", &pdch->id)) != SRD_OK) { ret = SRD_ERR_PYTHON; @@ -331,11 +327,7 @@ SRD_API int srd_decoder_load(const char *module_name) py_basedec = py_method = py_attr = NULL; - if (!(d = g_try_malloc0(sizeof(struct srd_decoder)))) { - srd_dbg("Failed to g_malloc() struct srd_decoder."); - ret = SRD_ERR_MALLOC; - goto err_out; - } + d = g_malloc0(sizeof(struct srd_decoder)); ret = SRD_ERR_PYTHON; @@ -367,7 +359,7 @@ SRD_API int srd_decoder_load(const char *module_name) Py_CLEAR(py_basedec); /* - * Check that thіs decoder has the correct PD API version. + * Check that this decoder has the correct PD API version. * PDs of different API versions are incompatible and cannot work. */ py_long = PyObject_GetAttrString(d->py_dec, "api_version");