Again, I comment it here because I cannot do it in the right line.

g_free(ap);

is not enough as it is not freeing the string in the ofono_gprs_provision_data struct inside apndb_provision_data.