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

Commit e689d01d authored by Sandhya Mutha Naga Venkata's avatar Sandhya Mutha Naga Venkata
Browse files

audio: hal: Avoid deallocated memory access

[Issue] : Enable disable BT multiple times causing segmentation fault.
[Root cause] : Trying to access the pointer which is already freed.
[Fix] : Updating pointer with NULL after deallocation.

Change-Id: I763e4c874d4fab92c6d75315ea96a613dfdcb131
parent 178c93d0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

 * Changes from Qualcomm Innovation Center are provided under the following license:

 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.

 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted (subject to the limitations in the
@@ -1732,6 +1732,8 @@ done:

void platform_info_deinit()
{
    if (my_data.kvpairs)
    if (my_data.kvpairs) {
        str_parms_destroy(my_data.kvpairs);
        my_data.kvpairs = NULL;
    }
}