X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=type_decoder.c;h=35187a598a2d6ca19c5f09441f02955340e2468b;hb=8ad9a3e48ddf79e08cd48073c953ea665c464005;hp=dfa3fa9e269bb5d5ae984b74290edee775a6dba6;hpb=48518538aef9dc7ceb2c603319a26ff8750f361e;p=libsigrokdecode.git diff --git a/type_decoder.c b/type_decoder.c index dfa3fa9..35187a5 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -186,12 +186,12 @@ static int convert_binary(struct srd_decoder_inst *di, PyObject *obj, goto err; } - pdb = g_malloc(sizeof(struct srd_proto_data_binary)); if (PyBytes_AsStringAndSize(py_tmp, &buf, &size) == -1) goto err; PyGILState_Release(gstate); + pdb = g_malloc(sizeof(struct srd_proto_data_binary)); pdb->bin_class = bin_class; pdb->size = size; if (!(pdb->data = g_try_malloc(pdb->size))) {