SHA256
1
0
forked from pool/systemd
systemd/1011-libudev-avoid-leak-during-realloc-failure.patch
Stephan Kulow 48af67da26 Accepting request 147673 from Base:System
- udev: path_id - handle Hyper-V devices
  add: 1008-udev-path_id-handle-Hyper-V-devices.patch
- keymap: Update the list of Samsung Series 9 models
  add: 1009-keymap-Update-the-list-of-Samsung-Series-9-models.patch
- keymap: Add Samsung 700T
  add: 1010-keymap-Add-Samsung-700T.patch
- libudev: avoid leak during realloc failure
  add: 1011-libudev-avoid-leak-during-realloc-failure.patch
- libudev: do not resolve $attr{device} symlinks
  add: 1012-libudev-do-not-resolve-attr-device-symlinks.patch
- libudev: validate 'udev' argument to udev_enumerate_new()
  add: 1013-libudev-validate-udev-argument-to-udev_enumerate_new.patch
- udev: fix whitespace
  add: 1014-udev-fix-whitespace.patch
- udev: properly handle symlink removal by 'change' event
  add: 1015-udev-properly-handle-symlink-removal-by-change-event.patch
- udev: builtin - do not fail builtin initialization if one of 
  them returns an error
  add: 1016-udev-builtin-do-not-fail-builtin-initialization-if-o.patch
- udev: use usec_t and now()
  add: 1017-udev-use-usec_t-and-now.patch 

  closing an non-existent dbus connection and getting assertion 
  failures. 
- udev: path_id - handle Hyper-V devices
  add: 1008-udev-path_id-handle-Hyper-V-devices.patch
- keymap: Update the list of Samsung Series 9 models
  add: 1009-keymap-Update-the-list-of-Samsung-Series-9-models.patch
- keymap: Add Samsung 700T
  add: 1010-keymap-Add-Samsung-700T.patch

OBS-URL: https://build.opensuse.org/request/show/147673
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=120
2013-01-10 14:20:01 +00:00

37 lines
1.6 KiB
Diff

From cf2292f5ac87087f57dbd632a25a332c9d194ebf Mon Sep 17 00:00:00 2001
From: Mauro Dreissig <mukadr@gmail.com>
Date: Sun, 11 Nov 2012 22:07:51 -0200
Subject: [PATCH] libudev: avoid leak during realloc failure
---
src/libudev/libudev-list.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: systemd-195/src/libudev/libudev-list.c
===================================================================
--- systemd-195.orig/src/libudev/libudev-list.c
+++ systemd-195/src/libudev/libudev-list.c
@@ -177,18 +177,20 @@ struct udev_list_entry *udev_list_entry_
if (list->unique) {
/* allocate or enlarge sorted array if needed */
if (list->entries_cur >= list->entries_max) {
+ struct udev_list_entry **entries;
unsigned int add;
add = list->entries_max;
if (add < 1)
add = 64;
- list->entries = realloc(list->entries, (list->entries_max + add) * sizeof(struct udev_list_entry *));
- if (list->entries == NULL) {
+ entries = realloc(list->entries, (list->entries_max + add) * sizeof(struct udev_list_entry *));
+ if (entries == NULL) {
free(entry->name);
free(entry->value);
free(entry);
return NULL;
}
+ list->entries = entries;
list->entries_max += add;
}