| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c7ece46 commit 781ad96
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -992,18 +992,17 @@ static MaybeLocal<Value> GetX509NameObject(Environment* env, X509* cert) { | |||
| 992 | 992 | if (value_str_size < 0) { | |
| 993 | 993 | return Undefined(env->isolate()); | |
| 994 | 994 | } | |
| 995 | + auto free_value_str = OnScopeLeave([&]() { OPENSSL_free(value_str); }); | ||
| 995 | 996 | ||
| 996 | 997 | Local<String> v8_value; | |
| 997 | 998 | if (!String::NewFromUtf8(env->isolate(), | |
| 998 | 999 | reinterpret_cast<const char*>(value_str), | |
| 999 | 1000 | NewStringType::kNormal, | |
| 1000 | - value_str_size).ToLocal(&v8_value)) { | ||
| 1001 | - OPENSSL_free(value_str); | ||
| 1001 | + value_str_size) | ||
| 1002 | + .ToLocal(&v8_value)) { | ||
| 1002 | 1003 | return MaybeLocal<Value>(); | |
| 1003 | 1004 | } | |
| 1004 | 1005 | ||
| 1005 | - OPENSSL_free(value_str); | ||
| 1006 | - | ||
| 1007 | 1006 | // For backward compatibility, we only create arrays if multiple values | |
| 1008 | 1007 | // exist for the same key. That is not great but there is not much we can | |
| 1009 | 1008 | // change here without breaking things. Note that this creates nested data | |
| Back | FazBrowse Home | New Git URL |
0 commit comments