Fix coverty issue 1097769 for strtok_r
[platform/core/connectivity/bluetooth-agent.git] / ag-agent / bluetooth-ag-agent.c
index 957fdf7..71d6b1c 100644 (file)
@@ -2792,7 +2792,7 @@ static gboolean __bt_ag_agent_is_device_vr_blacklisted(const char *lap_addr)
 
        rewind(fp);
 
-       buffer = g_malloc0(sizeof(char) * size);
+       buffer = g_malloc0((sizeof(char) * size) + 1);
        if (buffer == NULL) {
                ERR("g_malloc0 is failed");
                fclose(fp);