]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix load of the rsa key from base64
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Sep 2018 12:11:25 +0000 (13:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Sep 2018 12:11:25 +0000 (13:11 +0100)
src/lua/lua_rsa.c

index 938fabec2a907b80e23c938bd1626e6eebcc71dd..50702199b4dfea2833cad7b362ef29120d27f1d2 100644 (file)
@@ -357,7 +357,6 @@ lua_rsa_privkey_load_base64 (lua_State *L)
                }
 
                b = BIO_new_mem_buf (decoded, dec_len);
-               g_free (decoded);
                rsa = d2i_RSAPrivateKey_bio (b, NULL);
 
                if (rsa == NULL) {
@@ -372,6 +371,7 @@ lua_rsa_privkey_load_base64 (lua_State *L)
                }
 
                BIO_free (b);
+               g_free (decoded);
        }
        else {
                return luaL_error (L, "invalid arguments");