From: Martin Ling Date: Sun, 18 Jan 2015 22:43:02 +0000 (+0000) Subject: C++: Fix segfault where input/output options are NULL. X-Git-Tag: libsigrok-0.4.0~677 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=48d92e2c2e6291412e8a4d2218184112ebf0fad9;p=libsigrok.git C++: Fix segfault where input/output options are NULL. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 9dc003ac..bb709fe2 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -1388,12 +1388,15 @@ string InputFormat::description() map> InputFormat::options() { const struct sr_option **options = sr_input_options_get(_structure); - auto option_array = shared_ptr( - options, sr_input_options_free); map> result; - for (int i = 0; options[i]; i++) - result[options[i]->id] = shared_ptr