X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fbackend.c;h=637f7de99aaf3dbfc4696b6894c39f94095821d1;hb=6ae536258977b8a38bd7c58ad9a86fec5e4feece;hp=5f5f4e88d7f8cb2dd68e34d26fe068b145316079;hpb=17bfaca62aaacec71c6da4bd927af051727593b6;p=libsigrok.git diff --git a/src/backend.c b/src/backend.c index 5f5f4e88..637f7de9 100644 --- a/src/backend.c +++ b/src/backend.c @@ -238,10 +238,6 @@ static int sanity_check_all_input_modules(void) sr_err("No description in module %d ('%s').", i, d); errors++; } - if (!inputs[i]->format_match) { - sr_err("No format_match in module %d ('%s').", i, d); - errors++; - } if (!inputs[i]->init) { sr_err("No init in module %d ('%s').", i, d); errors++; @@ -250,6 +246,10 @@ static int sanity_check_all_input_modules(void) sr_err("No receive in module %d ('%s').", i, d); errors++; } + if (!inputs[i]->end) { + sr_err("No end in module %d ('%s').", i, d); + errors++; + } if (errors == 0) continue; @@ -348,12 +348,7 @@ SR_API int sr_init(struct sr_context **ctx) } /* + 1 to handle when struct sr_context has no members. */ - context = g_try_malloc0(sizeof(struct sr_context) + 1); - - if (!context) { - ret = SR_ERR_MALLOC; - goto done; - } + context = g_malloc0(sizeof(struct sr_context) + 1); #ifdef HAVE_LIBUSB_1_0 ret = libusb_init(&context->libusb_ctx);