UBC-ECE-Sasha / PIM-Embedding-Lookup

6 stars 5 forks source link

Missing malloc NULL checks #8

Open johnramsden opened 3 years ago

johnramsden commented 3 years ago

Anytime malloc is called, the result should be checked in case it is NULL and ENOMEM occurred.

https://github.com/UBC-ECE-Sasha/PIM-Embedding-Lookup/blob/1830cfbfb4fb21d810d3a6411575b717440c2a62/upmem/src/emb_host.c#L61

buffers = malloc(NR_TABLES*sizeof(struct embedding_buffer*)); 
if (buffers == NULL) {
   // ...
}
nzarif commented 3 years ago

That is true. Thanks