Просмотр исходного кода

libdpkg: Do not use m_malloc in push_checkpoint

This avoids a cyclic dependency between ehandle.c and m_lib.c.
Guillem Jover лет назад: 16
Родитель
Сommit
4afef203d5
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      lib/dpkg/ehandle.c

+ 6 - 1
lib/dpkg/ehandle.c

@@ -187,7 +187,12 @@ void push_checkpoint(int mask, int value) {
   struct cleanupentry *cep;
   int i;
   
-  cep= m_malloc(sizeof(struct cleanupentry) + sizeof(char*));
+  cep = malloc(sizeof(struct cleanupentry) + sizeof(char *));
+  if (cep == NULL) {
+    onerr_abort++;
+    ohshite(_("out of memory for new cleanup entry"));
+  }
+
   for (i=0; i<NCALLS; i++) { cep->calls[i].call=NULL; cep->calls[i].mask=0; }
   cep->cpmask= mask; cep->cpvalue= value;
   cep->argc= 0; cep->argv[0]= NULL;