File: memleak.dpatch

package info (click to toggle)
libdbd-pg-perl 1.49-2%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 680 kB
  • ctags: 381
  • sloc: perl: 3,921; ansic: 3,183; makefile: 99; sh: 22
file content (27 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh -e

# DP: Fix memory leak reported in #305468

if [ $# -ne 1 ]; then
    echo >&2 "$0: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -f -p0 < $0;;
    -unpatch) patch -f -R -p0 < $0;;
    *)
        echo >&2 "$0: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- dbdimp.c.old	2005-05-04 15:15:02.676996008 +0200
+++ dbdimp.c	2005-05-04 15:18:11.817242320 +0200
@@ -1544,6 +1544,7 @@
 				currph->quotedlen = 4;
 			}
 			else {
+				if (currph->quoted) Safefree(currph->quoted);
 				currph->quoted = currph->bind_type->quote(currph->value, currph->valuelen, &currph->quotedlen);
 			}
 		}