#include <sys/time.h>
#include <signal.h>
+#include <assert.h>
static int n = 10;
static meshlink_handle_t **mesh;
}
static bool exportmeshgraph(const char *path) {
+ assert(path);
+
struct stat ps;
int psr = stat(path, &ps);
}
// We found the key and the value. We already added it at the top, so ignore this one.
- if(sep[1] == '=' && sep[2] == ' ' && !strcmp(sep + 3, value))
+ if(value && sep[1] == '=' && sep[2] == ' ' && !strcmp(sep + 3, value))
continue;
// We found the key but with a different value, delete it if wanted.
if(fread(buf + len - fsize - 1, fsize, 1, f) != 1) {
logger(mesh, MESHLINK_DEBUG, "Error reading from %s: %s\n", filename, strerror(errno));
fclose(f);
+ free(buf);
meshlink_errno = MESHLINK_ESTORAGE;
pthread_mutex_unlock(&(mesh->mesh_mutex));
return NULL;
/* If the node is not reachable anymore but we remember it had an edge to us, clean it up */
- if(report && !c->node->status.reachable) {
+ if(report && c->node && !c->node->status.reachable) {
edge_t *e;
e = lookup_edge(c->node, mesh->self);
if(e) {