]> sigrok.org Git - libserialport.git/blobdiff - serialport.c
sp_list_ports(): Actually set list_ptr NULL as documented.
[libserialport.git] / serialport.c
index f2d2edcd3b56349feb85e4116defe25f64201ceb..e4f02fc58dde6d1cde27f5863eff49dae0f326e2 100644 (file)
@@ -334,6 +334,8 @@ SP_API enum sp_return sp_list_ports(struct sp_port ***list_ptr)
        if (!list_ptr)
                RETURN_ERROR(SP_ERR_ARG, "Null result pointer");
 
+       *list_ptr = NULL;
+
 #ifdef NO_ENUMERATION
        RETURN_ERROR(SP_ERR_SUPP, "Enumeration not supported on this platform");
 #else