vector mpvec;
int i;
- if (!(vecs->pathvec = vector_alloc()))
+ if (!vecs->pathvec && !(vecs->pathvec = vector_alloc()))
return 1;
- if (!(vecs->mpvec = vector_alloc()))
+ if (!vecs->mpvec && !(vecs->mpvec = vector_alloc()))
return 1;
if (!(mpvec = vector_alloc()))
/*
* save new set of maps formed by considering current path state
*/
+ vector_free(vecs->mpvec);
vecs->mpvec = mpvec;
/*
if (VECTOR_SIZE(vecs->pathvec))
free_pathvec(vecs->pathvec, FREE_PATHS);
+ vecs->pathvec = NULL;
conf = NULL;
if (load_config(DEFAULT_CONFIGFILE))
if (!vecs->lock)
goto out;
- vecs->pathvec = vector_alloc();
-
- if (!vecs->pathvec)
- goto out1;
-
- vecs->mpvec = vector_alloc();
-
- if (!vecs->mpvec)
- goto out2;
-
pthread_mutex_init(vecs->lock, NULL);
return vecs;
-out2:
- vector_free(vecs->pathvec);
-out1:
- FREE(vecs->lock);
out:
FREE(vecs);
condlog(0, "failed to init paths");