av1_cx_iface,encoder_set_option: add missing alloc check

Bug: aomedia:3276
Change-Id: Ib8494b8ccef0455c659bd7a4b579f38664d2ce55
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 1e0fb75..0db25e6 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -3536,6 +3536,7 @@
 #endif
 
   argv[0] = aom_malloc(len * sizeof(argv[1][0]));
+  if (!argv[0]) return AOM_CODEC_MEM_ERROR;
   snprintf(argv[0], len, "--%s=%s", name, value);
   struct arg arg;
   aom_codec_err_t err = AOM_CODEC_OK;