debug/hist.c Access .. results in a dereference of a null
Maybe this is only a bug if a call to HistAdd() is made before HistCreate(). SonarCloud debug/hist.c:147 Access to field 'hi_cum' results in a dereference of a null pointer (loaded from variable 'h') https://sonarcloud.io/project/issues?open=AZJB17kdNGfDNup0RkzB&id=dlmiles_magic
This commit is contained in:
parent
60fe6427da
commit
8e0f34c6f1
|
|
@ -141,8 +141,10 @@ HistAdd(name, ptrKeys, value)
|
|||
{
|
||||
Histogram * h;
|
||||
|
||||
if((h=histFind(name, ptrKeys))==(Histogram *) NULL)
|
||||
if((h=histFind(name, ptrKeys))==(Histogram *) NULL) {
|
||||
HistCreate(name, ptrKeys, 0, 20, 10);
|
||||
h=histFind(name, ptrKeys);
|
||||
}
|
||||
|
||||
h->hi_cum+=value;
|
||||
if(value < h->hi_lo)
|
||||
|
|
|
|||
Loading…
Reference in New Issue