summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wcmValidateDevice.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
index af3b153..e62946e 100644
--- a/src/wcmValidateDevice.c
+++ b/src/wcmValidateDevice.c
@@ -437,10 +437,12 @@ static InputAttributes* wcmDuplicateAttributes(InputInfoPtr pInfo,
{
int rc;
InputAttributes *attr;
+ char *product;
+
attr = DuplicateInputAttributes(pInfo->attrs);
- rc = asprintf(&attr->product, "%s %s", attr->product, type);
- if (rc == -1)
- attr->product = NULL;
+ rc = asprintf(&product, "%s %s", attr->product, type);
+ free(attr->product);
+ attr->product = (rc != -1) ? product : NULL;
return attr;
}
#endif