Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 970e8945 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "media: Silence an analyzer complaint; clean up code"

parents d3f4b874 20d18966
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ JNIAudioAttributeHelper::UniqueAaPtr JNIAudioAttributeHelper::makeUnique()
{
    audio_attributes_t *aa = new (calloc(1, sizeof(audio_attributes_t)))
                audio_attributes_t{AUDIO_ATTRIBUTES_INITIALIZER};
    return UniqueAaPtr{aa, free};
    return UniqueAaPtr{aa};
}

jint JNIAudioAttributeHelper::nativeFromJava(JNIEnv* env, jobject jAudioAttributes,
+5 −1
Original line number Diff line number Diff line
@@ -27,7 +27,11 @@ namespace android {
class JNIAudioAttributeHelper
{
public:
    using UniqueAaPtr = std::unique_ptr<audio_attributes_t, decltype(free)*>;
    struct FreeDeleter {
        void operator()(void *p) const { ::free(p); }
    };

    using UniqueAaPtr = std::unique_ptr<audio_attributes_t, FreeDeleter>;

    /**
     * @brief makeUnique helper to prevent leak