We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3a9e3b commit 8e02270Copy full SHA for 8e02270
tools/power/cpupower/utils/helpers/bitmask.c
@@ -26,11 +26,11 @@ struct bitmask *bitmask_alloc(unsigned int n)
26
struct bitmask *bmp;
27
28
bmp = malloc(sizeof(*bmp));
29
- if (bmp == 0)
+ if (!bmp)
30
return 0;
31
bmp->size = n;
32
bmp->maskp = calloc(longsperbits(n), sizeof(unsigned long));
33
- if (bmp->maskp == 0) {
+ if (!bmp->maskp) {
34
free(bmp);
35
36
}
@@ -40,7 +40,7 @@ struct bitmask *bitmask_alloc(unsigned int n)
40
/* Free `struct bitmask` */
41
void bitmask_free(struct bitmask *bmp)
42
{
43
44
return;
45
free(bmp->maskp);
46
bmp->maskp = (unsigned long *)0xdeadcdef; /* double free tripwire */
0 commit comments