~ubuntu-branches/debian/sid/trinity/sid

« back to all changes in this revision

Viewing changes to utils.c

  • Committer: Package Import Robot
  • Author(s): gustavo panizzo
  • Date: 2014-01-17 21:10:15 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140117211015-k2qbnpu0osa5mlil
Tags: 1.3-1
* New upstream version 1.3.
* Removed wrong dependency on linux-headers. (Closes: #733771).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
#include <stdio.h>
 
3
#include <string.h>
 
4
#include "utils.h"
 
5
 
 
6
void * zmalloc(size_t size)
 
7
{
 
8
        void *p;
 
9
 
 
10
        p = malloc(size);
 
11
        if (p == NULL) {
 
12
                printf("malloc(%zu) failure.\n", size);
 
13
                exit(EXIT_FAILURE);
 
14
        }
 
15
 
 
16
        memset(p, 0, size);
 
17
        return p;
 
18
}