Hi again, On Wed, Oct 17, 2018 at 8:28 AM Jonas Bonn wrote: > > Hi, > > > On 17/10/18 06:52, Giacinto Cifelli wrote: > > Added voicecall atom specific for Gemalto modems. > > diff --git a/drivers/gemaltomodem/voicecall.c b/drivers/gemaltomodem/voicecall.c > > new file mode 100644 > > index 00000000..8e2c7e10 > > --- /dev/null > > +++ b/drivers/gemaltomodem/voicecall.c > > @@ -0,0 +1,581 @@ > > +static void gemalto_send_dtmf(struct ofono_voicecall *vc, const char *dtmf, > > + ofono_voicecall_cb_t cb, void *data) > > +{ > > + int len = strlen(dtmf); > > + int s; > > + int i; > > + char *buf; > > + struct ofono_modem *modem = ofono_voicecall_get_modem(vc); > > + int use_quotes = ofono_modem_get_integer(modem, "GemaltoVtsQuotes"); > > + > > + /* strlen("+VTS=\"T\";") = 9 + initial AT + null */ > > + buf = g_new(char, len * 9 + 3); > > Use alloca() instead... currently you are leaking buf. Gladly, excellent idea. Stack allocation is very sparingly used in ofono, while it would be a better alternative in many cases. Regards, Giacinto