X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi.c;h=7604411384a9fcec385cffad37ec9b18673c37c7;hb=91219afc75c9aa1d0c5e2da5c03343c1e43eb6df;hp=bb7099786d2c21b9bc2c8170bc47cf45fb9dc8d2;hpb=c368e6f3d248a73d69cd0c2c4a7c88a92def55e3;p=libsigrok.git diff --git a/src/scpi/scpi.c b/src/scpi/scpi.c index bb709978..76044113 100644 --- a/src/scpi/scpi.c +++ b/src/scpi/scpi.c @@ -742,12 +742,7 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi, } g_free(response); - hw_info = g_try_malloc(sizeof(struct sr_scpi_hw_info)); - if (!hw_info) { - g_strfreev(tokens); - return SR_ERR_MALLOC; - } - + hw_info = g_malloc0(sizeof(struct sr_scpi_hw_info)); hw_info->manufacturer = g_strdup(tokens[0]); hw_info->model = g_strdup(tokens[1]); hw_info->serial_number = g_strdup(tokens[2]);