Skip to content

Commit

Permalink
tests: Use free rather than TPM_Free (OS/X)
Browse files Browse the repository at this point in the history
Use free rather than TPM_Free to avoid the following warning:

tpm2_setprofile.c:377:18: warning: passing 'char *' to parameter \
  of type 'unsigned char *' converts between pointers to integer \
  types with different sign [-Wpointer-sign]

        TPM_Free(profile);

../include/libtpms/tpm_memory.h:57:36: note: passing argument to \
  parameter 'buffer' here

void       TPM_Free(unsigned char *buffer);

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Aug 30, 2024
1 parent 16e648e commit f5518e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/tpm2_setprofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>

Expand Down Expand Up @@ -374,7 +375,7 @@ int main(void)
profile, testcases[i].exp_profile);
goto exit;
}
TPM_Free(profile);
free(profile);
profile = NULL;

for (j = 0;
Expand Down Expand Up @@ -412,7 +413,7 @@ int main(void)
ret = 0;

exit:
TPM_Free(profile);
free(profile);
TPM_Free(rbuffer);

return ret;
Expand Down

0 comments on commit f5518e5

Please sign in to comment.