#include "memory.h"
DEFINE_MTYPE_STATIC(LIB, VECTOR, "Vector")
-DEFINE_MTYPE( LIB, VECTOR_INDEX, "Vector index")
+DEFINE_MTYPE_STATIC(LIB, VECTOR_INDEX, "Vector index")
/* Initialize vector : allocate memory and return vector. */
vector
return v;
}
-void
-vector_only_wrapper_free (vector v)
-{
- XFREE (MTYPE_VECTOR, v);
-}
-
-void
-vector_only_index_free (void *index)
-{
- XFREE (MTYPE_VECTOR_INDEX, index);
-}
-
void
vector_free (vector v)
{
#define _ZEBRA_VECTOR_H
#include "memory.h"
-DECLARE_MTYPE(VECTOR_INDEX)
/* struct for vector */
struct _vector
extern int vector_set_index (vector v, unsigned int i, void *val);
extern void vector_unset (vector v, unsigned int i);
extern unsigned int vector_count (vector v);
-extern void vector_only_wrapper_free (vector v);
-extern void vector_only_index_free (void *index);
extern void vector_free (vector v);
extern vector vector_copy (vector v);
vty_backward_pure_word (vty);
vty_insert_word_overwrite (vty, matched[0]);
XFREE (MTYPE_TMP, matched[0]);
- vector_only_index_free (matched);
- return;
break;
case CMD_COMPLETE_LIST_MATCH:
for (i = 0; matched[i] != NULL; i++)
break;
}
if (matched)
- vector_only_index_free (matched);
+ XFREE (MTYPE_TMP, matched);
}
static void
printf(" '%s'\n", completions[j]);
XFREE(MTYPE_TMP, completions[j]);
}
- XFREE(MTYPE_VECTOR_INDEX, completions);
+ XFREE(MTYPE_TMP, completions);
}
vty->node = cnode->node;
if (rl_end && isspace ((int) rl_line_buffer[rl_end - 1]))
vector_set (vline, NULL);
- if (matched)
- XFREE (MTYPE_TMP, matched);
matched = cmd_complete_command (vline, vty, &complete_status);
cmd_free_strvec (vline);
}
if (matched && matched[index])
return matched[index++];
+ XFREE (MTYPE_TMP, matched);
+ matched = NULL;
+
return NULL;
}