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

Commit 8bcac1f2 authored by Ray Essick's avatar Ray Essick Committed by android-build-merger
Browse files

Fix free-after-use for MediaHTTP am: dd81e159 am: 1e6019cb

am: e5e80181

Change-Id: I883340c6418a6b3e09431cd377891e0168b41f72
parents 202df686 e5e80181
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -58,15 +58,19 @@ status_t MediaHTTP::connect(
        extHeaders.add(String8("User-Agent"), String8(MakeUserAgent().c_str()));
    }

    bool success = mHTTPConnection->connect(uri, &extHeaders);
    mLastURI = uri;
    // reconnect() calls with uri == old mLastURI.c_str(), which gets zapped
    // as part of the above assignment. Ensure no accidental later use.
    uri = NULL;

    bool success = mHTTPConnection->connect(mLastURI.c_str(), &extHeaders);

    mLastHeaders = extHeaders;
    mLastURI = uri;

    mCachedSizeValid = false;

    if (success) {
        AString sanitized = uriDebugString(uri);
        AString sanitized = uriDebugString(mLastURI);
        mName = String8::format("MediaHTTP(%s)", sanitized.c_str());
    }