summaryrefslogtreecommitdiff
path: root/type_decoder.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-02-10 00:06:58 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-02-10 09:30:41 +0100
commita61ece2022f9e765d65dcd0ed22dba7e71e138a2 (patch)
treed8804a8808ca70bd23149e5de4329272608e95d7 /type_decoder.c
parenta33a0e3bd59214cc4ddb021389f5c2ad91134587 (diff)
downloadlibsigrokdecode-a61ece2022f9e765d65dcd0ed22dba7e71e138a2.tar.gz
libsigrokdecode-a61ece2022f9e765d65dcd0ed22dba7e71e138a2.zip
srd: Add/improve g_malloc() error messages.
Diffstat (limited to 'type_decoder.c')
-rw-r--r--type_decoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/type_decoder.c b/type_decoder.c
index 9c2cfd6..028865b 100644
--- a/type_decoder.c
+++ b/type_decoder.c
@@ -124,8 +124,10 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args)
di->instance_id, start_sample, end_sample,
OUTPUT_TYPES[pdo->output_type], output_id);
- if (!(pdata = g_try_malloc0(sizeof(struct srd_proto_data))))
+ if (!(pdata = g_try_malloc0(sizeof(struct srd_proto_data)))) {
+ srd_err("Failed to g_malloc() struct srd_proto_data.");
return NULL;
+ }
pdata->start_sample = start_sample;
pdata->end_sample = end_sample;
pdata->pdo = pdo;