X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibudev%2Flibudev-queue-private.c;h=d5a2b503dd39c189cd7f792780c6262aa576de4b;hb=df1e02046144f41176c32ed011369fd8dba36b76;hp=367395d9849062d2ede9ed248836a2d57f69aee4;hpb=47ef94ac5f39db6c5c18be10afe32397a0a8d5cc;p=elogind.git diff --git a/src/libudev/libudev-queue-private.c b/src/libudev/libudev-queue-private.c index 367395d98..d5a2b503d 100644 --- a/src/libudev/libudev-queue-private.c +++ b/src/libudev/libudev-queue-private.c @@ -1,14 +1,22 @@ -/* - * libudev - interface to udev device information - * - * Copyright (C) 2008 Kay Sievers - * Copyright (C) 2009 Alan Jenkins - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - */ +/*** + This file is part of systemd. + + Copyright 2008-2012 Kay Sievers + Copyright 2009 Alan Jenkins + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see . +***/ /* * DISCLAIMER - The file format mentioned here is private to udev/libudev, @@ -71,7 +79,7 @@ struct udev_queue_export *udev_queue_export_new(struct udev *udev) if (udev == NULL) return NULL; - udev_queue_export = calloc(1, sizeof(struct udev_queue_export)); + udev_queue_export = new0(struct udev_queue_export, 1); if (udev_queue_export == NULL) return NULL; udev_queue_export->udev = udev; @@ -154,7 +162,7 @@ static struct queue_devpaths *build_index(struct udev_queue_export *udev_queue_e udev_err(udev_queue_export->udev, "queue file overflow\n"); return NULL; } - devpaths = calloc(1, sizeof(struct queue_devpaths) + (range + 1) * sizeof(long)); + devpaths = malloc0(sizeof(struct queue_devpaths) + (range + 1) * sizeof(long)); if (devpaths == NULL) return NULL; devpaths->devpaths_size = range + 1;