Diff

Differences From Artifact [335a817cb9]:

To Artifact [257a2172b2]:


    28     28   				pinPrompt = strdup("Please enter your PIN: ");
    29     29   			}
    30     30   
    31     31   			printf("%s: ", pinPrompt);
    32     32   			fflush(stdout);
    33     33   
    34     34   			free(pinPrompt);
           35  +
           36  +			pinPrompt = NULL;
    35     37   
    36     38   			fgets(pin, sizeof(pin), stdin);
    37     39   			while (strlen(pin) >= 1 && pin[strlen(pin) - 1] == '\n') {
    38     40   				pin[strlen(pin) - 1] = '\0';
    39     41   			}
    40     42   
    41     43   			signLength = sizeof(signBuffer);
    42     44   			rvSign = cackey_chrome_signMessage(&certificates[idxCertificate], "Test", 4, signBuffer, &signLength, &pinPrompt, pin);
    43     45   		}
           46  +
           47  +		if (pinPrompt != NULL) {
           48  +			free(pinPrompt);
           49  +		}
    44     50   
    45     51   		printf("Signed message \"Test\": %lu bytes (return value = %i)\n", signLength, rvSign);
    46     52   	}
    47     53   
    48     54   	cackey_chrome_freeCertificates(certificates, numCertificates);
    49     55   
    50     56   	cackey_chrome_terminate();
    51     57   
    52     58   	return(0);
    53     59   }