Fixed bug in power buffer allocation.
This commit is contained in:
parent
56ffd537b6
commit
8a70a931bb
|
@ -27,7 +27,7 @@ powerbuf_t powerbuf_new(unsigned int max_samples, unsigned int interval_us)
|
||||||
if (!pb)
|
if (!pb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (pb->max_samples <= 0) {
|
if (max_samples <= 0) {
|
||||||
free(pb);
|
free(pb);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue