[SBI] Fix minor memleak when creating S-NSSAI discovery option (#2740)

This commit is contained in:
Bostjan Meglic 2023-11-21 13:39:04 +01:00 committed by GitHub
parent 2d8ea152df
commit 18b1095697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -3044,6 +3044,9 @@ char *ogs_sbi_discovery_option_build_snssais(
snssaiItem = OpenAPI_snssai_convertToJSON(&sNSSAI);
ogs_assert(snssaiItem);
cJSON_AddItemToArray(item, snssaiItem);
if (sNSSAI.sd)
ogs_free(sNSSAI.sd);
}
v = cJSON_PrintUnformatted(item);