py: fix null pointer dereference in mpz.c, fix missing va_end in warning.c
diff --git a/py/mpz.c b/py/mpz.c
index cceb079..1dd177b 100644
--- a/py/mpz.c
+++ b/py/mpz.c
@@ -1652,7 +1652,10 @@
 // assumes enough space as calculated by mp_int_format_size
 // returns length of string, not including null byte
 mp_uint_t mpz_as_str_inpl(const mpz_t *i, mp_uint_t base, const char *prefix, char base_char, char comma, char *str) {
-    if (str == NULL || base < 2 || base > 32) {
+    if (str == NULL) {
+        return 0;
+    }
+    if (base < 2 || base > 32) {
         str[0] = 0;
         return 0;
     }
diff --git a/py/warning.c b/py/warning.c
index eae145b..4cdf3b3 100644
--- a/py/warning.c
+++ b/py/warning.c
@@ -38,6 +38,7 @@
     mp_print_str(&mp_plat_print, "Warning: ");
     mp_vprintf(&mp_plat_print, msg, args);
     mp_print_str(&mp_plat_print, "\n");
+    va_end(args);
 }
 
 void mp_emitter_warning(pass_kind_t pass, const char *msg) {