/*
- * Copyright (C) 2018 "IoT.bzh"
+ * Copyright (C) 2015-2020 "IoT.bzh"
* Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
pph = &set->globs;
else if (set->exacts)
pph = &set->exacts[hash & set->gmask];
- else
+ else {
+ *pprev = NULL;
return NULL;
+ }
while ((ph = *pph) && strcmp(normal, ph->handler.pattern))
pph = &ph->next;
*pprev = pph;
return ph;
}
-
-
-
-
-
-
-
/**
* Allocates a new set of handlers
*
}
/* not found, create it */
- ph = malloc(len + sizeof *ph);
+ ph = malloc(1 + len + sizeof *ph);
if (!ph)
return -1;