]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/serial.c
Return SR_ERR_MALLOC upon allocation errors.
[libsigrok.git] / hardware / common / serial.c
index 4a92a6684eba4edac865ab4c6ccd6658e1989877..38d4a5f121e08acaeb35da9340f095a14e1c65de 100644 (file)
@@ -166,7 +166,7 @@ SR_PRIV void *serial_backup_params(int fd)
        /* TODO: 'term' is never g_free()'d? */
        if (!(term = g_try_malloc(sizeof(struct termios)))) {
                sr_err("serial: %s: term malloc failed", __func__);
-               return NULL;
+               return -1;
        }
 
        tcgetattr(fd, term);