snipsco / snips-nlu-rs

Snips NLU rust implementation
https://snips.ai
Other
340 stars 56 forks source link

Fix error handling in Python wrapper #134

Closed adrienball closed 5 years ago

adrienball commented 5 years ago

Description The Rust <--> Python binding was not handling properly errors happening on the Rust side. More precisely, memory behind pointers was deallocated without checking that it had actually been allocated at some point. When an error occurs in a rust API call, the memory behind the result pointer is often not allocated as the error happens before the result is created. As a result, instead of getting a python exception, you receive a segmentation fault.