Filename check and free allocated strings

Make sure file is valid before we try to read it. Also free all the
strings we allocate in various functions so we don't leak memory.

Change-Id: Ica3c8dae992e73718c79c12ff5d7e315c290caea
diff --git a/edify/expr.c b/edify/expr.c
index 72e5100..df3c1ab 100644
--- a/edify/expr.c
+++ b/edify/expr.c
@@ -67,6 +67,7 @@
     for (i = 0; i < argc; ++i) {
         free(strings[i]);
     }
+    free(strings);
     return result;
 }
 
@@ -389,11 +390,13 @@
             for (j = 0; j < i; ++j) {
                 free(args[j]);
             }
+            free(args);
             return -1;
         }
         *(va_arg(v, char**)) = args[i];
     }
     va_end(v);
+    free(args);
     return 0;
 }