+/*
+ * "items(blob)" function
+ * Converts a Blob into a List of [index, byte] pairs.
+ * Caller must have already checked that argvars[0] is a Blob.
+ * A null blob behaves like an empty blob.
+ */
+ void
+blob2items(typval_T *argvars, typval_T *rettv)
+{
+ blob_T *blob = argvars[0].vval.v_blob;
+
+ if (rettv_list_alloc(rettv) == FAIL)
+ return;
+
+ for (int i = 0; i < blob_len(blob); i++)
+ {
+ list_T *l2 = list_alloc();
+ if (l2 == NULL)
+ return;


Memory leak rettv?

+
+ if (list_append_list(rettv->vval.v_list, l2) == FAIL)
+ {
+ vim_free(l2);
+ return;
+ }
+
+ if (list_append_number(l2, i) == FAIL
+ || list_append_number(l2, blob_get(blob, i)) == FAIL)
+ return;


Memory leak l2?


+ }
+}



Christ van Willegen

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/CA%2BOt1Oxgsmeq0pGvSWRNo99Yg997yK4skv%3DyLFW6JHSAgNXSrA%40mail.gmail.com.

Raspunde prin e-mail lui