Temporary variable service may leak memory at abnormal cases in function sm_service_table_add.

Bug #1837976 reported by YeHuiSheng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
YeHuiSheng

Bug Description

In the function sm_service_table_add, the temporary variable service point to new memory by malloc.
However, if sm_service_go_active_exists or sm_service_enable_exists doesn't return SM_OKAY, the function sm_service_table_add will return before add the temporary variable into list _services.
Then, the temporary variable service will leak the memory which is malloc in the function sm_service_table_add.

So, we need to add free function in these abnormal cases.

Tags: stx.ha
YeHuiSheng (hsye)
Changed in starlingx:
assignee: nobody → YeHuiSheng (hsye)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ha (master)

Fix proposed to branch: master
Review: https://review.opendev.org/672896

Changed in starlingx:
status: New → In Progress
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Low priority / Not Gating - code cleanup suggestion / no noted system impact

tags: added: stx.ha
Changed in starlingx:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ha (master)

Reviewed: https://review.opendev.org/672896
Committed: https://git.openstack.org/cgit/starlingx/ha/commit/?id=5696e1e56ddb906dfdd6fb59b01d3f65cb4a5441
Submitter: Zuul
Branch: master

commit 5696e1e56ddb906dfdd6fb59b01d3f65cb4a5441
Author: YeHuiSheng <email address hidden>
Date: Fri Jul 26 15:17:23 2019 +0800

    Modify memory leak in some abnormal cases by adding free function.

    Change-Id: I0076635d9c19d39637bf56a3404a4e4ad1f9506f
    Closes-Bug: #1837976
    Signed-off-by: YeHuiSheng <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.