Use src/ not lib/ as root of source in example Makefile.am code.
[gnulib.git] / lib / readtokens.c
index 8172eb1..c65c1b1 100644 (file)
@@ -31,6 +31,8 @@
 #include <string.h>
 #include <stdbool.h>
 
+#include "xalloc.h"
+
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
 #endif
@@ -195,5 +197,7 @@ readtokens (FILE *stream,
   *tokens_out = tokens;
   if (token_lengths != NULL)
     *token_lengths = lengths;
+  else
+    free (lengths);
   return n_tokens;
 }