Allocate data returned by pkcs7_t.get_attribute()
[strongswan.git] / src / libstrongswan / plugins / pkcs7 / pkcs7_signed_data.c
index 4c963ab..2ef9708 100644 (file)
@@ -323,7 +323,7 @@ METHOD(pkcs7_t, get_attribute, bool,
                chunk = e->info->attributes->get_attribute(e->info->attributes, oid);
                if (chunk.len)
                {
-                       *value = chunk;
+                       *value = chunk_clone(chunk);
                        return TRUE;
                }
        }