summaryrefslogtreecommitdiffstats
path: root/RPM4/src/RPM4.xs
diff options
context:
space:
mode:
authornanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2007-07-15 23:29:31 +0000
committernanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2007-07-15 23:29:31 +0000
commit642842ebd37a0a0f991a9416e11312c6a7facf90 (patch)
tree44155ae9bf9d2869a17c8cc1364c9833d2815c20 /RPM4/src/RPM4.xs
parent6a874bd8da2dc4309c2ab217542d4abcefc90ab9 (diff)
downloadperl-RPM4-642842ebd37a0a0f991a9416e11312c6a7facf90.tar
perl-RPM4-642842ebd37a0a0f991a9416e11312c6a7facf90.tar.gz
perl-RPM4-642842ebd37a0a0f991a9416e11312c6a7facf90.tar.bz2
perl-RPM4-642842ebd37a0a0f991a9416e11312c6a7facf90.tar.xz
perl-RPM4-642842ebd37a0a0f991a9416e11312c6a7facf90.zip
- kill useless malloc and mem leaks
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@131 971eb68f-4bfb-0310-8326-d2484c010a4c
Diffstat (limited to 'RPM4/src/RPM4.xs')
-rw-r--r--RPM4/src/RPM4.xs15
1 files changed, 2 insertions, 13 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index e0137fb..057617d 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -2885,14 +2885,8 @@ Spec_sources(spec, is = 0)
struct Source *srcPtr;
PPCODE:
for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) {
- char * dest = NULL;
- int len;
if (is && !(srcPtr->flags & is))
- continue;
- len = strlen(srcPtr->source);
- dest = malloc(len);
- memcpy(dest, srcPtr->source, len);
- XPUSHs(sv_2mortal(newSVpv(dest, len)));
+ XPUSHs(sv_2mortal(newSVpv(srcPtr->source, 0)));
}
void
@@ -2903,14 +2897,9 @@ Spec_sources_url(spec, is = 0)
struct Source * srcPtr;
PPCODE:
for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) {
- char * dest = NULL;
- int len;
if (is && !(srcPtr->flags & is))
continue;
- len = strlen(srcPtr->fullSource);
- dest = malloc(len);
- memcpy(dest, srcPtr->fullSource, len);
- XPUSHs(sv_2mortal(newSVpv(dest, len)));
+ XPUSHs(sv_2mortal(newSVpv(srcPtr->fullSource, 0)));
}
void