serial-dmm: Use g_malloc()/g_free().

This commit is contained in:
Uwe Hermann 2015-03-21 18:46:00 +01:00
parent c35276dd92
commit 145d794fac
1 changed files with 2 additions and 2 deletions

View File

@ -175,9 +175,9 @@ int receive_data(int fd, int revents, void *cb_data)
if (revents == G_IO_IN) { if (revents == G_IO_IN) {
/* Serial data arrived. */ /* Serial data arrived. */
info = malloc(dmm->info_size); info = g_malloc(dmm->info_size);
handle_new_data(sdi, info); handle_new_data(sdi, info);
free(info); g_free(info);
} else { } else {
/* Timeout; send another packet request if DMM needs it. */ /* Timeout; send another packet request if DMM needs it. */
if (dmm->packet_request && (req_packet(sdi) < 0)) if (dmm->packet_request && (req_packet(sdi) < 0))