mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 04:50:12 -07:00
coverity fix
This commit is contained in:
parent
24c85e74ac
commit
a96e94b872
1 changed files with 7 additions and 4 deletions
|
@ -110,24 +110,27 @@ void initSampleBuffer(uint32_t *sample_size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initSampleBufferEx(uint32_t *sample_size, bool use_malloc) {
|
void initSampleBufferEx(uint32_t *sample_size, bool use_malloc) {
|
||||||
|
if (sample_size == NULL) {
|
||||||
|
Dbprintf("initSampleBufferEx, param NULL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
BigBuf_free();
|
BigBuf_free();
|
||||||
|
|
||||||
|
|
||||||
// We can't erase the buffer now, it would drastically delay the acquisition
|
// We can't erase the buffer now, it would drastically delay the acquisition
|
||||||
|
|
||||||
if (use_malloc) {
|
if (use_malloc) {
|
||||||
|
|
||||||
if (sample_size == NULL || *sample_size == 0) {
|
if (*sample_size == 0) {
|
||||||
*sample_size = BigBuf_max_traceLen();
|
*sample_size = BigBuf_max_traceLen();
|
||||||
data.buffer = BigBuf_get_addr();
|
data.buffer = BigBuf_get_addr();
|
||||||
} else {
|
} else {
|
||||||
*sample_size = MIN(*sample_size, BigBuf_max_traceLen());
|
*sample_size = MIN(*sample_size, BigBuf_max_traceLen());
|
||||||
data.buffer = BigBuf_malloc(*sample_size);
|
data.buffer = BigBuf_malloc(*sample_size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (sample_size == NULL || *sample_size == 0) {
|
if (*sample_size == 0) {
|
||||||
*sample_size = BigBuf_max_traceLen();
|
*sample_size = BigBuf_max_traceLen();
|
||||||
}
|
}
|
||||||
data.buffer = BigBuf_get_addr();
|
data.buffer = BigBuf_get_addr();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue