fix: null check

This commit is contained in:
iceman1001 2019-03-16 07:31:00 +01:00
parent 3efa05060e
commit c83b2e7fff

View file

@ -93,10 +93,12 @@ int GetModels(char *Models[], int *count, uint8_t *width) {
PrintAndLogEx(WARNING, "out of memory?"); PrintAndLogEx(WARNING, "out of memory?");
return 0; return 0;
} }
if ( model.name != NULL ) {
memcpy(tmp, model.name, size); memcpy(tmp, model.name, size);
Models[mode] = tmp; Models[mode] = tmp;
width[mode] = plen(model.spoly); width[mode] = plen(model.spoly);
} }
}
mfree(&model); mfree(&model);
} else { //reveng -s } else { //reveng -s